Replies: 1 comment
-
|
Running into the same thing on objects such as "ShopListingWithAssociations" which has all fields as optional, while one would expect listingId to be required. This is leading to a lot more code, and having to guess which missing data really needs to be accounted for with error handling, warning pages etc... and which data is just always going to be there anyway. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I noticed that throughout the Etsy OpenAPI specification, schemas define fields with
nullable: true/falsebut don't specify therequiredarray at the object level (or therequiredproperty for each field). According to the OpenAPI specification, this means all fields are technically optional, regardless of theirnullablestatus.For example, in the
Userschema:This seems counterintuitive -
user_idwould logically be a required field for aUserobject, but without being listed in a required array at the schema level, it's technically optional according to the spec.Questions:
nullable: trueshould be optional, and the required array is missing from the spec?Context: I'm using swagger-typescript-api to generate a TypeScript SDK, and having all fields marked as optional (?:) in the generated types/SDK feels incorrect, especially for fundamental fields like user_id.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions