-
Notifications
You must be signed in to change notification settings - Fork 50
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
Issues with using the specs for code generation or validation #11
Comments
Hi @geoah, thank you very much for your extensive feedback! We've just added a more detailed specification for additionalData and we are also exploring better ways for displaying it.
3 and 4. We didn't describe them before, but it's definitely on our list.
|
With the updated specs today, here is the latest status: 1, 2, 5, 7 - we moved all
Hope this solves all the potential problems with it.
@geoah many thanks again for reporting all this. For now, I'm closing this one, but please feel free to re-open or create more, in case you see more room for improving our OpenAPI files. |
We're trying to using these specs to validate requests/responses or generating code from them and we're bumping onto some issues.
The following issues come from Checkout v51 and Payment v51 as of e2dd2fc.
1. Inline items with
itemNr
cursorThere are a number of items on the spec (under additional data) that seem to be defined as key-value items but as a user I assume you are expected to replace the
itemNr
with the item's location in the array.Some examples:
adyen-openapi/specs/json/CheckoutService-v51.json
Lines 828 to 831 in e2dd2fc
adyen-openapi/specs/json/CheckoutService-v51.json
Lines 708 to 711 in e2dd2fc
adyen-openapi/specs/json/CheckoutService-v51.json
Lines 1004 to 1007 in e2dd2fc
2. Additional data contains object with duplicate attributes
The
anyOf
used for theadditionalData
attributes contains a number of references that contain duplicate attributes.For example
enhancedSchemeData.customerReference
appears in bothAdditionalDataLevel23
andAdditionalDataTemporaryServices
.I understand that this might be technically valid OpenAPI but seems to result in issues when generating code and complicates the logic of matching the various options for the attribute.
adyen-openapi/specs/json/CheckoutService-v51.json
Lines 2206 to 2222 in e2dd2fc
adyen-openapi/specs/json/CheckoutService-v51.json
Lines 1142 to 1147 in e2dd2fc
adyen-openapi/specs/json/CheckoutService-v51.json
Lines 670 to 675 in e2dd2fc
3. Missing
securitySchemes
The
X-Api-Key
header that is required for authentication is only mentioned in a description and thesecuritySchemes
is not being used so the header is not enforced in any of the paths.4. Missing
Idempotency-Key
headerThe
Idempotency-Key
header is not defined for any of the paths.5. Amounts have the wrong type
All amounts have their types marked as
number
where according to their description they should be integers, which OpenAPI supports.adyen-openapi/specs/json/CheckoutService-v51.json
Lines 680 to 687 in e2dd2fc
6. Attributes have no validation
The main interest would be string/number/array limits for this.
Docs for each attribute mention the min/max length of the attribute but the spec doesn't enforce it.
7. Missing enums
A number of attributes seem to be enums, but don't appear as such. The attribute description will mention something like
Values can be x, y, z
.adyen-openapi/specs/json/CheckoutService-v51.json
Lines 780 to 783 in e2dd2fc
The text was updated successfully, but these errors were encountered: