Skip to content

Commit a9ed452

Browse files
AzqueltMikeEdgar
andauthored
Add default json dialect to model (#2163)
Co-authored-by: Michael Edgar <michael@xlate.io>
1 parent 150657b commit a9ed452

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

core/src/test/java/io/smallrye/openapi/runtime/io/OpenApiParserAndSerializerTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,11 @@ void testSchemas_XML() throws IOException, JSONException {
611611
doMultiVersionTest("schemas-with-xml.json", "schemas-with-xml30.json", ConversionDirection.BOTH_WAYS);
612612
}
613613

614+
@Test
615+
void testNonDefaultSchemaDialect() throws IOException, JSONException {
616+
doTest("non-default-schema-dialect.json", Format.JSON);
617+
}
618+
614619
/**
615620
* Test method for {@link OpenApiParser#parse(java.net.URL)}.
616621
*/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"openapi" : "3.1.0",
3+
"info" : {
4+
"title": "Sample App",
5+
"version": "1.0.1"
6+
},
7+
"jsonSchemaDialect": "http://example.com/test-dialect",
8+
"components": {
9+
"schemas": {
10+
"testSchema": {
11+
"type": 4,
12+
"fields": ["a", "b", "c"]
13+
},
14+
"baseDialectSchema": {
15+
"$schema": "https://spec.openapis.org/oas/3.1/dialect/base",
16+
"type": "object",
17+
"properties": {
18+
"a": {
19+
"type": "string"
20+
},
21+
"b": {
22+
"type": "integer"
23+
}
24+
}
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)