Closed ColinEberhardt closed 1 year ago
Looking at the spec, despite the media type specifying application/json
, primitive values are indeed acceptable https://swagger.io/specification/#schema-object
After further exploration, this is not a bug. Strings, when returned from the API, should be quoted, making them valid JSON. For example "hello"
is valid JSON.
The Petstore example API server has a bug relating to this. I've raised a PR:
See: https://github.com/ScottLogic/openapi-forge-typescript/blob/main/template/fetch.ts#L8
This is probably true for the JS generator also