1
1
package com .amartus .sonata .blender .parser ;
2
2
3
3
import com .fasterxml .jackson .databind .JsonNode ;
4
- import com .fasterxml .jackson .databind .node .ObjectNode ;
5
4
import io .swagger .v3 .oas .models .media .Schema ;
6
5
import io .swagger .v3 .parser .util .OpenAPIDeserializer ;
7
6
import org .slf4j .Logger ;
12
11
public class DeserializerProvider {
13
12
private static final Logger log = LoggerFactory .getLogger (DeserializerProvider .class );
14
13
static class AmartusDeserializer extends OpenAPIDeserializer {
15
- private Optional <String > getByName (ObjectNode node , String name ) {
14
+ private Optional <String > getByName (JsonNode node , String name ) {
16
15
return Optional .ofNullable (node .get (name ))
17
16
.map (JsonNode ::textValue );
18
17
}
19
18
20
19
@ Override
21
- public Schema getSchema (ObjectNode node , String location , ParseResult result ) {
20
+ public Schema getSchema (JsonNode node , String location , ParseResult result ) {
22
21
var schema = super .getSchema (node , location , result );
23
22
if (schema .get$ref () != null ) {
24
23
@@ -27,7 +26,7 @@ public Schema getSchema(ObjectNode node, String location, ParseResult result) {
27
26
schema .setDescription (d );
28
27
});
29
28
}
30
- getByName (node ,"$id" ).ifPresent (id -> schema .addExtension ("x-try-renaming-on" , id ));
29
+ getByName (node , "$id" ).ifPresent (id -> schema .addExtension ("x-try-renaming-on" , id ));
31
30
return schema ;
32
31
}
33
32
}
0 commit comments