Interpret OpenAPI examples and example fields #1076
Unanswered
adrien1212
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Hi @adrien1212 can you share sample openAPI file, will verify it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @rangav openapi: 3.0.0
info:
description: Api to handle client in daily database
title: Client api
version: "1.0"
servers:
- url: /
tags:
- name: client
paths:
/clients:
post:
operationId: create
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ClientSearchCriteria'
examples:
default:
$ref: '#/components/examples/defaultListRequest'
responses:
default:
content:
application/json:
examples:
default:
$ref: '#/components/examples/defaultListResponse'
schema:
items:
$ref: '#/components/schemas/ClientSearchCriteria'
type: array
description: default response
components:
schemas:
ClientSearchCriteria:
properties:
clientId:
type:
string
name:
type:
string
type: object
examples:
defaultListRequest:
value:
cliendId: "clientId body request"
name: "name body request"
defaultListResponse:
value:
cliendId: "clientId response"
name: "name response" Thunder interpretationIt could be good to have instead {
"clientId": "clientId body request",
"name": "name body request"
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Does Thunder interpret
examples
andexample
fields ?For example, in the specification of OpenAPI we can define examples for body request/response
SwaggerUI interpret it but I don't think Thunder do it.
Example :
So SwaggerUI interpret the example and add it automatically in the request
But in Thunder there is only the schema without being completed with the example
So the user must fill it in by hand
Beta Was this translation helpful? Give feedback.
All reactions