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 save openapi to yaml ( ObjectMapperFactory.createYaml(true).writeValueAsString(openApi) )
some fields (with null type) in extensions disappear
in licence section "extensions" word appear, but it shouldn't be there
As far I understand, parsing works correctly with extensions, but creating yaml works with bugs
Full code to reproduce:
importio.swagger.parser.OpenAPIParser;
importio.swagger.v3.core.util.ObjectMapperFactory;
publicclassMain {
publicstaticvoidmain(String[] args) {
System.out.println("Hello World!");
OpenAPIParserparser = newOpenAPIParser();
varresult = parser.readContents("""openapi: 3.1.0info: title: Sample Pet Store App contact: name: API Support url: https://www.example.com/support email: [email protected] x-myext: key1: 1 key2: null license: name: asassaas x-licence: key1: 1 key2: null version: 1.0.1 summary: A pet store manager. x-info: key1: 1 key2: null """, null, null);
varopenApi = result.getOpenAPI();
// now save it as yamlvarisV31 = true;
try {
varyaml = ObjectMapperFactory.createYaml(true).writeValueAsString(openApi);
System.out.println(yaml);
} catch (Exceptione) {
e.printStackTrace();
}
}
}
output is:
openapi: 3.1.0info:
title: Sample Pet Store Appcontact:
name: API Supporturl: https://www.example.com/supportemail: [email protected]x-myext:
key1: 1license:
name: asassaasextensions:
x-licence:
key1: 1version: 1.0.1summary: A pet store manager.x-info:
key1: 1servers:
- url: /
When save openapi to yaml (
ObjectMapperFactory.createYaml(true).writeValueAsString(openApi)
)As far I understand, parsing works correctly with extensions, but creating yaml works with bugs
Full code to reproduce:
output is:
dependencies:
The text was updated successfully, but these errors were encountered: