Xero-OpenAPI icon indicating copy to clipboard operation
Xero-OpenAPI copied to clipboard

Schema inconsistent with document : everything marked as optional

Open QuentinLemCode opened this issue 1 year ago • 3 comments

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

QuentinLemCode avatar Aug 27 '24 16:08 QuentinLemCode

PETOSS-553

github-actions[bot] avatar Aug 27 '24 16:08 github-actions[bot]

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

github-actions[bot] avatar Aug 27 '24 16:08 github-actions[bot]

Do NOT run it.

It's malware that'll steal your account if executed, to spread further spamming the same message elsewhere, like happened to this person.

There are a lot of comments like that

https://github.com/search?q=is%3Aissue+%22In+the+installer+menu%2C+select+%5C%22gcc.%5C%22%22+AND+%22password%3A+changeme%22&type=issues&s=created&o=desc

(and this is how I found this issue)

MahouShoujoMivutilde avatar Aug 27 '24 18:08 MahouShoujoMivutilde