Skip to content

Enum param values are listed as empty objects instead of strings

First, let me be the first to thank you for putting this together. We had been looking to upgrade from Swagger 2.0 to OAS 3.0 so this project gave us a great opportunity to give it a try. It was a fairly painless upgrade from fastify-swagger for our documentation (which at this point is pretty basic).

After upgrading we did run into one issue so far with enum params. It looks like the docs generate enum values as empty objects instead of the strings themselves. Here's an example of the generated JSON for an enum param in paths..get.parameters:

{
  "name": "myEnum",
  "in": "query",
  "schema": {
    "type": "string",
    "enum": [
      {},
      {}
    ]
  }
}

This shows up in the UI as Available values : OrderedMap {}, OrderedMap {}. I put together a quick example showing the issue here: https://github.com/jro619/fastify-oas-enum-issue.

I can try to find some time to debug the root cause. If so I'll submit a PR.

Thanks!

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information