Skip to content

fix: OpenAPI specs based on API implementation#806

Open
rvab wants to merge 5 commits into
mainfrom
single_role_non_nested_1
Open

fix: OpenAPI specs based on API implementation#806
rvab wants to merge 5 commits into
mainfrom
single_role_non_nested_1

Conversation

@rvab

@rvab rvab commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Please add PR description here, add screenshots if needed

Clickup

app.clickup.com

@github-actions github-actions Bot added the size/M Medium PR label Jul 10, 2026
Comment thread reference/admin.yaml
dependent_expense_field_values_upload_out:
type: object
additionalProperties: false
required:

@rvab rvab Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the modified files inside reference folder is auto generated from the updated schemas

@rvab rvab requested a review from abhishek1234321 July 10, 2026 06:07
Comment thread reference/admin.yaml
Comment on lines -16107 to -16109
- band
- code
- description

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields don't have required=True flag

@rvab rvab requested a review from KirtiGautam July 10, 2026 06:08
is_enabled:
$ref: ./fields.yaml#/is_enabled
required:
- id

@abhishek1234321 abhishek1234321 Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required list here describes response-property presence, while Marshmallow required=False controls request deserialization.

Example

This is a valid request because id, band, code, and description are optional request inputs:

{
  "name": "Level 1",
  "is_enabled": true
}

The API still serializes all four keys in the response:

{
  "id": "lvlf2yiY7usuX",
  "name": "Level 1",
  "band": null,
  "code": null,
  "description": null,
  "is_enabled": true
}

With the current level_out.required, generated types are approximately:

type Level = {
  id: string;
  band: string | null;
  code: string | null;
  description: string | null;
};

After removing these entries, generators may produce:

type Level = {
  id?: string;
  band?: string | null;
  code?: string | null;
  description?: string | null;
};

That makes external SDKs treat guaranteed response keys as potentially absent.

Verification against latest fyle-platform-api master

Please keep all four entries in level_out.required; request optionality is already represented separately by level_in.

properties:
id:
$ref: './fields.yaml#/id_string'
nullable: true

@abhishek1234321 abhishek1234321 Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runtime API returns a string card ID, not null.

Example

Actual response shape:

{
  "id": "bacctW9DfNhwOt",
  "card_number": "****3464"
}

This change attempts to allow a response that the runtime cannot produce:

{
  "id": null,
  "card_number": "****3464"
}

There is also an OpenAPI 3.0.3 issue. As written:

id:
  $ref: ./fields.yaml#/id_string
  nullable: true

nullable is a sibling of the reference and is ignored by compliant OpenAPI 3.0 tools, so the change currently has no effect. Making it effective with allOf would instead generate an unnecessarily weak type such as:

id?: string | null;

Verification against latest fyle-platform-api master

Please remove nullable: true rather than making it effective. Documenting the ID as nullable would not match runtime behavior and would weaken generated external SDK types.

@rvab rvab force-pushed the single_role_non_nested_1 branch from dbcba50 to 39681ac Compare July 10, 2026 08:18
@rvab rvab requested a review from sumanth-fyle1 July 10, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR

Development

Successfully merging this pull request may close these issues.

2 participants