OpenAPI.NET: Incorrect data-type errors for valid response examples
Errors are thrown if a response example is given for a string property defined in a schema that also happens to parse as a number.
The following produces the error Data and type mismatch found. [#/paths/~1test/get/responses/200/content/application~1json/example/BrokenProperty]
openapi: 3.0.1
info:
title: BrokenFunction
description: This will not parse
version: '1.0'
paths:
'/test':
get:
summary: GetTest
operationId: getTest
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/Example'
example:
BrokenProperty: '1234'
components:
schemas:
Example:
type: object
properties:
BrokenProperty:
type: string
description: Customer Identifier
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (9 by maintainers)
Guys I am trying to update an API that is in Azure API management that I previously deployed a few weeks ago. Now I am getting the incorrect data-type error for date examples when importing an updated api definition. Some of which are mandatory fields. The api definition passes validation in Swaggerhub fine. Now I have to demo the api to a client in 2 days using the Azure API developer portal but the API definitions are old and I can’t update them. So I am asking for an Eta for a fix. The client keeps asking if we can move to AWS. Might have to look seriously at doing that if this isn’t working soon.
I am also getting this when trying to import an open api 3.0.1 into the Azure API Management portal. Can I get an ETA on this? Over 3 months now and the impact quite large.