ad-on-is / adonis-autoswagger

Auto-Generate swagger docs for AdonisJS
MIT License
129 stars 41 forks source link

required field in schema #90

Closed pdipax closed 6 months ago

pdipax commented 6 months ago

Hi, if I write @props({"required": true}) in the model this work only for the swagger standard UI but only in properties of schema field.

The schema OpenAPI is not correct because the object it should be written like this

App:
  type: "object"
  required:
    - description
    - code
    - blablabla

while it is currently populated in the schema field properties. If it were possible, a new @required decorator should be added which, if indicated in the model column, should correctly populate the information in the yaml model

pdipax commented 6 months ago

I created two PRs, see if you like them

ad-on-is commented 6 months ago

this is meant just for metadata like minlemgth, etc... maybe I should rename it to meta