Open kevbook opened 3 weeks ago
In the OpenAPI spec, when an enum key exists, it's not respected in mock responses. See example:
enum
"responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "number", "enum": [200] } }, "required": ["status"], "additionalProperties": false } } } } }
Just using standard library
import { fromOpenApi } from '@mswjs/source/open-api' import api from './api.spec.json' const handlers = await fromOpenApi(api) // Result when using client Result: { status: 16.76 }
Description
In the OpenAPI spec, when an
enum
key exists, it's not respected in mock responses. See example:Just using standard library
Reproduction steps
Expected behavior
Initial assessment
Screenshots