ad-on-is / adonis-autoswagger

Auto-Generate swagger docs for AdonisJS
MIT License
97 stars 32 forks source link

required field in schema #90

Closed pdipax closed 1 month ago

pdipax commented 1 month 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 1 month ago

I created two PRs, see if you like them

ad-on-is commented 1 month ago

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