-
Notifications
You must be signed in to change notification settings - Fork 4
[auto] Update openapi dependency #1505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[auto] Update openapi dependency #1505
Conversation
| export interface PatchObjectConfigContentRequest { | ||
| /** | ||
| * The ID of the user group that has access to this installation. | ||
| * Either groupRef or installationId must be provided. | ||
| * @type {string} | ||
| * @memberof PatchObjectConfigContentRequest | ||
| */ | ||
| groupRef: string; | ||
| /** | ||
| * The action type for the object config (read, subscribe, or write). | ||
| * @type {string} | ||
| * @memberof PatchObjectConfigContentRequest | ||
| */ | ||
| action: PatchObjectConfigContentRequestActionEnum; | ||
| /** | ||
| * Array of JSON Patch operations to apply. | ||
| * @type {Array<JSONPatchOperation>} | ||
| * @memberof PatchObjectConfigContentRequest | ||
| */ | ||
| changes: Array<JSONPatchOperation>; | ||
| /** | ||
| * The installation ID. | ||
| * Either groupRef or installationId must be provided. | ||
| * @type {string} | ||
| * @memberof PatchObjectConfigContentRequest | ||
| */ | ||
| installationId: string; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface requires both groupRef and installationId as mandatory fields (non-optional), but the documentation states "Either groupRef or installationId must be provided." This creates an impossible constraint where callers must provide both fields when they should only provide one.
// Current (broken) - requires BOTH:
export interface PatchObjectConfigContentRequest {
groupRef: string; // not optional
action: PatchObjectConfigContentRequestActionEnum;
changes: Array<JSONPatchOperation>;
installationId: string; // not optional
}
// Should be (one of these approaches):
// Option 1: Make them optional
export interface PatchObjectConfigContentRequest {
groupRef?: string;
action: PatchObjectConfigContentRequestActionEnum;
changes: Array<JSONPatchOperation>;
installationId?: string;
}
// Option 2: Use a discriminated union typeThis will cause runtime failures when API calls are made with only one identifier, as TypeScript will require both fields to be present.
| export interface PatchObjectConfigContentRequest { | |
| /** | |
| * The ID of the user group that has access to this installation. | |
| * Either groupRef or installationId must be provided. | |
| * @type {string} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| groupRef: string; | |
| /** | |
| * The action type for the object config (read, subscribe, or write). | |
| * @type {string} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| action: PatchObjectConfigContentRequestActionEnum; | |
| /** | |
| * Array of JSON Patch operations to apply. | |
| * @type {Array<JSONPatchOperation>} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| changes: Array<JSONPatchOperation>; | |
| /** | |
| * The installation ID. | |
| * Either groupRef or installationId must be provided. | |
| * @type {string} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| installationId: string; | |
| } | |
| export interface PatchObjectConfigContentRequest { | |
| /** | |
| * The ID of the user group that has access to this installation. | |
| * Either groupRef or installationId must be provided. | |
| * @type {string} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| groupRef?: string; | |
| /** | |
| * The action type for the object config (read, subscribe, or write). | |
| * @type {string} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| action: PatchObjectConfigContentRequestActionEnum; | |
| /** | |
| * Array of JSON Patch operations to apply. | |
| * @type {Array<JSONPatchOperation>} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| changes: Array<JSONPatchOperation>; | |
| /** | |
| * The installation ID. | |
| * Either groupRef or installationId must be provided. | |
| * @type {string} | |
| * @memberof PatchObjectConfigContentRequest | |
| */ | |
| installationId?: string; | |
| } | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
| export function instanceOfPatchObjectConfigContentRequest(value: object): boolean { | ||
| let isInstance = true; | ||
| isInstance = isInstance && "groupRef" in value; | ||
| isInstance = isInstance && "action" in value; | ||
| isInstance = isInstance && "changes" in value; | ||
| isInstance = isInstance && "installationId" in value; | ||
|
|
||
| return isInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation function checks that both groupRef AND installationId are present, contradicting the documented behavior that only one should be provided. This will cause valid requests to fail validation.
// Current (broken):
export function instanceOfPatchObjectConfigContentRequest(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "groupRef" in value; // requires groupRef
isInstance = isInstance && "action" in value;
isInstance = isInstance && "changes" in value;
isInstance = isInstance && "installationId" in value; // AND installationId
return isInstance;
}
// Should be:
export function instanceOfPatchObjectConfigContentRequest(value: object): boolean {
let isInstance = true;
isInstance = isInstance && ("groupRef" in value || "installationId" in value); // OR
isInstance = isInstance && "action" in value;
isInstance = isInstance && "changes" in value;
return isInstance;
}| export function instanceOfPatchObjectConfigContentRequest(value: object): boolean { | |
| let isInstance = true; | |
| isInstance = isInstance && "groupRef" in value; | |
| isInstance = isInstance && "action" in value; | |
| isInstance = isInstance && "changes" in value; | |
| isInstance = isInstance && "installationId" in value; | |
| return isInstance; | |
| export function instanceOfPatchObjectConfigContentRequest(value: object): boolean { | |
| let isInstance = true; | |
| isInstance = isInstance && ("groupRef" in value || "installationId" in value); | |
| isInstance = isInstance && "action" in value; | |
| isInstance = isInstance && "changes" in value; | |
| return isInstance; | |
| } | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
This updates the dependency to version 27560f51ea2ed4830bba01e3ec3493e09111ef0a from main