-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
In the OpenAPI spec, when an enum
key exists, it's not respected in mock responses. See example:
"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 }
Reproduction steps
Expected behavior
Initial assessment
Screenshots
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working