Repository navigation
Open
Description
When the parser is doing the conversion from OAS2 to OAS3, a parameter of type in: "body" in OAS2 is converted to a requestBody in OAS3.
Example:
OAS2:
- name: "requestList"
in: "body"
description: "Requests to post"
required: true
schema:
$ref: "#/definitions/listitems"OAS3:
requestBody:
description: Requests to post
content:
application/json:
schema:
$ref: '#/components/schemas/listitems'
required: trueDuring the operation, the parameter name is lost. Would it be possible to have a x-name added to the request body, in order to keep the information of the OAS2?
Expected result after the change?
requestBody:
x-name: "requestList"
description: Requests to post
content:
application/json:
schema:
$ref: '#/components/schemas/listitems'
required: trueIf you are interested I might be able to propose a PR for that.
Thank you in advance for your answer.
Complete input example:
swagger: "2.0"
info:
description: Container Application Model Description
version: 1.0.0
title: ContainerApplication
host: localhost:32000
basePath: /api/v1.0
schemes:
- http
tags:
- name: ApplicationEndpointTest
x-displayName: "ApplicationEndpointTest"
description: |
"Test of endpoints "
paths:
/default/EndpointTest:
post:
tags:
- ApplicationEndpointTest
description: "post a request"
operationId: callEndpoint
consumes:
- application/json
parameters:
- name: "requestList"
in: "body"
description: "Requests to post"
required: true
schema:
$ref: "#/definitions/listitems"
responses:
200:
description: "Successful response"
404:
description: "The request was not successfully executed."
definitions:
listitems :
description: "list of items"
type: array
items:
type: "string"Reacted by Jason Mac, Kevin Locke, Joffrey Bion and Clément Vannicatte
Metadata
Metadata
Assignees
Labels
No labels
Activity