vmware / vmware-openapi-generator

VMware-openapi-generator tool generates open-api documents from vapi metamodel format.
Other
23 stars 19 forks source link

Mark required fields properly #25

Closed jrgarcia closed 5 years ago

jrgarcia commented 5 years ago

Currently, 'OPTIONAL' fields are marked as not required, but we don't mark anything as required otherwise and you have to explicitly mark things as required for openapi-generator to mark them as such in the binding. This fixes that issue by marking everything as required and then marking it as not required if it is 'OPTIONAL'.

jrgarcia commented 5 years ago

@sreeshas @alanrenouf @strefethen I'm not sure how these will affect other uses, but I needed to add this to generate bindings appropriately. This change marks all fields required and changes any optional fields to optional. Prior to this change, everything on the Ruby SDK was set to optional meaning everything had to be passed in a Hash, it didn't give you any hints as to what was required, and all of the documentation said every field on every model was optional. This worked just fine for me in generating a new Ruby SDK, but I wanted you all to confirm that this would work ok for other possible uses (e.g. API Explorer).

alanrenouf commented 5 years ago

Looks good to me in the API Explorer.

image