-
Notifications
You must be signed in to change notification settings - Fork 537
Closed
Description
Given this Swagger Spec as input:
swagger: '2.0'
info:
title: some title
version: '1.0'
host: 'localhost:8000'
schemes:
- http
- https
paths: {}
definitions:
A:
type: string
parameters:
b:
name: e
in: body
schema:
$ref: '#/definitions/A'
The converted output is expected to be:
{
"openapi" : "3.0.1",
"info" : {
"title" : "some title",
"version" : "1.0"
},
"servers" : [ {
"url" : "http://localhost:8000/"
}, {
"url" : "https://localhost:8000/"
} ],
"paths" : { },
"components" : {
"schemas" : {
"A" : {
"type" : "string"
}
},
"requestBodies" : {
"b" : {
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/A"
}
}
},
"required" : false
}
}
}
}
But for the moment $ref is #/definitions/A instead of #/components/schemas/A
Conversion made with:
OpenAPIV3Parser openApiParser = new OpenAPIV3Parser();
ParseOptions options = new ParseOptions();
OpenAPI openAPI = openApiParser.read(file, null, options);
With following libraries on the Classpath:
io.swagger.parser.v3:swagger-parser-v3:2.0.0-rc3io.swagger.parser.v3:swagger-parser-v2-converter:2.0.0-rc3
I have reproduced it with the last SNAPSHOT version
Metadata
Metadata
Assignees
Labels
No labels