0

how can does the right OpenAPI 3 definition looks like

possible endpoints:

  • /tickets (->/tickets?status=* - all Ticket no matter what status)
  • /tickets?satus=new
  • /tickets?satus=sold
  • /tickets?satus=canceled
  • /tickets?satus=new,sold
  • /tickets?satus=sold,canceled
  • /tickets?satus=any_othe_combination

With "enum:" the API only accept ONE parameter, or? Not a combination? Is it simple "value"?

... statusparam:

 name: status

 in: path

 schema:

    type: string

    value: ['*','new','sold','canceled','some1','some2','some3']

    default: '*'

BUT in swagger-ui the value is not checkt - onyl that it exists but i could also use"somethingnotinthelist " - swagger-ui will accept it

Can I use allowEmptyValue: true instead of *

Thanks for help rob

  • I found allowedValues but swagger UI still let me put in soem other values nor the values ar presentetd like they are when i would use enum ... relparam: name: relype in: query description: >- filter by relationshiptype schema: type: string allowedValues: ['*','new','sold','canceled','some1','some2','some3'] default: '*' – Robert Kuhlig Nov 21 '20 at 11:37
  • seems i mixed up swagger 2.0 and openAPI 3.0 But still swagger_ui is nor complaining when i enter somesthin different ... relparam: name: status in: query type: string pattern: '(all|new|sold|canceled|some1|some2|some3)' default: all – Robert Kuhlig Nov 21 '20 at 16:24
  • Does this answer your question? [Swagger: take one or more values from enum](https://stackoverflow.com/q/50538138/113116) – Helen Nov 23 '20 at 10:37

0 Answers0