File tree Expand file tree Collapse file tree
openapi-processor-core/src/testInt
kotlin/io/openapiprocessor/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ class CompileExpectedSpec: StringSpec({
7070 compilePaths.add(Path .of("src/testInt/resources/compile/jakarta/Size .java"))
7171 compilePaths.add(Path .of("src/testInt/resources/compile/jakarta/Valid .java"))
7272 compilePaths.add(Path .of("src/testInt/resources/compile/javax/Valid .java"))
73+ compilePaths.add(Path .of("src/testInt/resources/compile/oap/FooA .java"))
74+ compilePaths.add(Path .of("src/testInt/resources/compile/oap/FooB .java"))
75+ compilePaths.add(Path .of("src/testInt/resources/compile/oap/FooC .java"))
7376
7477 val expected = support.readTestItems(sourcePath, "outputs.yaml").items
7578 val expectedFileNames = expected.map { it.replaceFirst("<model>", "model/${testSet.modelType}") }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ val ALL_30: List<TestParams> = listOf(
1717 test30_D_(" bean-validation-requestbody" ),
1818 test30_D_(" bean-validation-requestbody-mapping" ),
1919 test30_DR(" components-requestbodies" ),
20+ test30_DR(" extension-mapping" ),
2021 test30_DR(" deprecated" ),
2122 test30_D_(" endpoint-exclude" ),
2223 test30_D_(" endpoint-http-mapping" ), // framework specific
@@ -86,6 +87,7 @@ val ALL_31: List<TestParams> = listOf(
8687 test31_D_(" bean-validation-requestbody" ),
8788 test31_D_(" bean-validation-requestbody-mapping" ),
8889 test31_DR(" components-requestbodies" ),
90+ test31_DR(" extension-mapping" ),
8991 test31_DR(" deprecated" ),
9092 test31_D_(" endpoint-exclude" ),
9193 test31_D_(" endpoint-http-mapping" ), // framework specific
Original file line number Diff line number Diff line change 1+ package io .oap ;
2+
3+ import java .lang .annotation .Documented ;
4+ import java .lang .annotation .Retention ;
5+ import java .lang .annotation .Target ;
6+
7+ import static java .lang .annotation .ElementType .FIELD ;
8+ import static java .lang .annotation .RetentionPolicy .CLASS ;
9+
10+ @ Documented
11+ @ Retention (CLASS )
12+ @ Target ({FIELD })
13+ public @interface FooA {
14+ String value ();
15+ }
Original file line number Diff line number Diff line change 1+ package io .oap ;
2+
3+ import java .lang .annotation .Documented ;
4+ import java .lang .annotation .Retention ;
5+ import java .lang .annotation .Target ;
6+
7+ import static java .lang .annotation .ElementType .FIELD ;
8+ import static java .lang .annotation .RetentionPolicy .CLASS ;
9+
10+ @ Documented
11+ @ Retention (CLASS )
12+ @ Target ({FIELD })
13+ public @interface FooB {
14+ }
Original file line number Diff line number Diff line change 1+ package io .oap ;
2+
3+ import java .lang .annotation .Documented ;
4+ import java .lang .annotation .Retention ;
5+ import java .lang .annotation .Target ;
6+
7+ import static java .lang .annotation .ElementType .FIELD ;
8+ import static java .lang .annotation .RetentionPolicy .CLASS ;
9+
10+ @ Documented
11+ @ Retention (CLASS )
12+ @ Target ({FIELD })
13+ public @interface FooC {
14+ }
Original file line number Diff line number Diff line change 1+ items :
2+ - inputs/openapi30.yaml
3+ - inputs/openapi31.yaml
4+ - inputs/mapping.yaml
Original file line number Diff line number Diff line change 1+ openapi-processor-mapping : v6
2+
3+ options :
4+ package-name : generated
5+ format-code : false
6+
7+ map :
8+ extensions :
9+ x-foo : single @ io.oap.FooA(value = "any")
10+ x-bar :
11+ - listA @ io.oap.FooB
12+ - listB @ io.oap.FooC
Original file line number Diff line number Diff line change 1+ openapi : 3.0.2
2+ info :
3+ title : test extension mapping
4+ version : 1.0.0
5+
6+ paths :
7+
8+ /foo :
9+ get :
10+ responses :
11+ ' 200 ' :
12+ description : the foo result
13+ content :
14+ application/json :
15+ schema :
16+ $ref : ' #/components/schemas/Foo'
17+
18+ components :
19+ schemas :
20+
21+ Foo :
22+ type : object
23+ properties :
24+ bar :
25+ type : string
26+ x-foo : single
27+ x-bar :
28+ - listA
29+ - listB
Original file line number Diff line number Diff line change 1+ openapi : 3.1.0
2+ info :
3+ title : test extension mapping
4+ version : 1.0.0
5+
6+ paths :
7+
8+ /foo :
9+ get :
10+ responses :
11+ ' 200 ' :
12+ description : the foo result
13+ content :
14+ application/json :
15+ schema :
16+ $ref : ' #/components/schemas/Foo'
17+
18+ components :
19+ schemas :
20+
21+ Foo :
22+ type : object
23+ properties :
24+ bar :
25+ type : string
26+ x-foo : single
27+ x-bar :
28+ - listA
29+ - listB
Original file line number Diff line number Diff line change 1+ items :
2+ - outputs/api/Api.java
3+ - outputs/<model>/Foo.java
You can’t perform that action at this time.
0 commit comments