Package io.github.microcks.util.openapi
Class OpenAPISchemaBuilder
java.lang.Object
io.github.microcks.util.openapi.OpenAPISchemaBuilder
Helper class for building/inferring a Json Schema from Json node object.
- Author:
- laurent
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.JsonNode
buildTypeSchemaFromJson
(com.fasterxml.jackson.databind.JsonNode node) Build the Json schema for the type corresponding to given Json node.static com.fasterxml.jackson.databind.JsonNode
buildTypeSchemaFromJson
(String jsonText) Build the Json schema for the type corresponding to given Json node provided as string.
-
Field Details
-
JSON_SCHEMA_TYPE
- See Also:
-
JSON_SCHEMA_ITEMS
- See Also:
-
JSON_SCHEMA_OBJECT_TYPE
- See Also:
-
JSON_SCHEMA_ARRAY_TYPE
- See Also:
-
JSON_SCHEMA_PROPERTIES
- See Also:
-
-
Method Details
-
buildTypeSchemaFromJson
public static com.fasterxml.jackson.databind.JsonNode buildTypeSchemaFromJson(String jsonText) throws IOException Build the Json schema for the type corresponding to given Json node provided as string.- Parameters:
jsonText
- The String representing Json node to introspect for building a Json schema- Returns:
- A JsonNode representing the Json Schema fragment for this type
- Throws:
IOException
- Tf given Json string cannot be parsed as Json
-
buildTypeSchemaFromJson
public static com.fasterxml.jackson.databind.JsonNode buildTypeSchemaFromJson(com.fasterxml.jackson.databind.JsonNode node) Build the Json schema for the type corresponding to given Json node.- Parameters:
node
- The Jackson Json node to introspect for building a Json schema- Returns:
- A JsonNode representing the Json Schema fragment for this type
-