Skip to content
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

Schema inconsistent with document : everything marked as optional #618

Open
QuentinLemCode opened this issue Aug 27, 2024 · 3 comments
Open

Comments

@QuentinLemCode
Copy link

QuentinLemCode commented Aug 27, 2024

Hello

There seems to have big inconsistencies on your OpenAPI definition.

I work with this file : https://github.com/XeroAPI/Xero-OpenAPI/blob/master/xero_accounting.yaml

By taking the GET /Payments/{PaymentID} endpoint definition, every field of the "Payment" schema is marked as optional : there is no required fields.

However, by looking at the developer documentation it seems that some fields are optional (Reference for example) but some seems required (like the Date field).

I can see that you reuse the Payment schema for creation request and read request. It's a good thing, however, for response, you can define your response schema by reusing your existing schema and add required property. Example below

    PaymentResponse:
      allOf:
        - $ref: '#/components/schemas/Payment'
      required:
        - Date

Could you fix the OpenAPI definition to mark fields always present as required please ?

Otherwise, could you provide some explanation about when the Date field can be undefined ?

Thanks

Copy link

PETOSS-553

Copy link

Thanks for raising an issue, a ticket has been created to track your request

@MahouShoujoMivutilde

This comment was marked as resolved.

@github-staff github-staff deleted a comment Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants