You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When several referenced schemas have the same name but different definitions, only the first two are created in components/schemas, the rest are ignored.
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.parser.core.models.ParseOptions;
public class Main {
public static void main(String[] args) {
ParseOptions options = new ParseOptions();
options.setResolve(true);
OpenAPI openAPI = new OpenAPIV3Parser().read("base.yaml", null, options);
System.out.println(openAPI.getComponents().getSchemas().keySet());
}
}
Result
[body, body_2]
Expected result
[body, body_1, body_2]
Note: In this case 3 schemas are expected since POST.type3.body and POST.type4.body have the same definition.
The text was updated successfully, but these errors were encountered:
BabisK
added a commit
to BabisK/swagger-parser
that referenced
this issue
Dec 2, 2020
When several referenced schemas have the same name but different definitions, only the first two are created in components/schemas, the rest are ignored.
base.yaml
config.yaml
main.java
Result
Expected result
Note: In this case 3 schemas are expected since
POST.type3.body
andPOST.type4.body
have the same definition.The text was updated successfully, but these errors were encountered: