aj-foster / open-api-generator

Open API code generator for Elixir
MIT License
97 stars 13 forks source link

Tags should be optional #12

Closed rubas closed 1 year ago

rubas commented 1 year ago

According to OpenAPI 3.0 specs the tags section is optional.

Not having a tags key in the json/yml breaks the library.

Example File

** (FunctionClauseError) no function clause matching in OpenAPI.Spec.decode_tags/2
The following arguments were given to OpenAPI.Spec.decode_tags/2:

....
Attempted function clauses (showing 1 out of 1):

defp decode_tags(state, %{"tags" => tags})

  lib/open_api/spec.ex:96: OpenAPI.Spec.decode_tags/2
  lib/open_api/spec.ex:53: OpenAPI.Spec.decode/1
  lib/open_api.ex:21: OpenAPI.run/2
aj-foster commented 1 year ago

Thank you for reporting this @rubas. An upcoming commit on main will fix this. Thank you also for the example spec file; it's a nice minimal addition to a future test suite.