Package de.kosmos_lab.web.server
Class OpenApiParser
- java.lang.Object
-
- de.kosmos_lab.web.server.OpenApiParser
-
public class OpenApiParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerloggerstatic HashSet<String>missingFromResourcestatic Class<? extends WebServer>serverClass
-
Constructor Summary
Constructors Constructor Description OpenApiParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadd(Parameter p, org.json.JSONArray params)static voidadd(Tag tag, org.json.JSONArray array)static voidadd(ApiEndpoint endpoint, Operation operation, Method method, org.json.JSONObject paths)static voidadd(String tag, boolean value, org.json.JSONObject json, Boolean ignoreIfThis)static voidadd(String tag, double value, org.json.JSONObject json, Double ignoreIfThis)static voidadd(String tag, int value, org.json.JSONObject json, Integer ignoreIfThis)static voidadd(String tag, ExternalDocumentation value, org.json.JSONObject json)static voidadd(String tag, Header[] value, org.json.JSONObject json)static voidadd(String tag, Contact contact, org.json.JSONObject json)static voidadd(String tag, License license, org.json.JSONObject json)static voidadd(String tag, Content[] value, org.json.JSONObject json)static voidadd(String tag, DiscriminatorMapping[] value, org.json.JSONObject json)static voidadd(String tag, ExampleObject[] examples, org.json.JSONObject json)static voidadd(String tag, SchemaProperty[] properties, org.json.JSONObject json)static voidadd(String tag, Schema schema, org.json.JSONObject json)static voidadd(String tag, OAuthFlow flow, org.json.JSONObject json)static voidadd(String tag, OAuthFlows flows, org.json.JSONObject json)static voidadd(String tag, Class<?>[] clzlist, org.json.JSONObject json)static voidadd(String tag, Class<?> clz, org.json.JSONObject json)static voidadd(String tag, String[] values, org.json.JSONObject json)static voidadd(String tag, String value, org.json.JSONObject json)static voidadd(String tag, String value, org.json.JSONObject json, boolean parseValue)static voidadd(String tag, org.json.JSONArray values, org.json.JSONObject json)static voidadd(String tag, org.json.JSONObject values, org.json.JSONObject json)static StringasYaml(String jsonString)static booleancheckExample(ExampleObject e, org.json.JSONObject schema, SchemaType type)static booleancheckExample(String value, org.json.JSONObject schema, SchemaType type)static TuplecheckExamples()used to check if the examples are all correctstatic voidcreate(HashSet<Class<? extends jakarta.servlet.http.HttpServlet>> pservlets)static org.json.JSONObjectcreateJSONSchemaFromSchema(org.json.JSONObject schema)static org.json.JSONObjectgetJSON()static StringgetStringFromResource(String name)static StringgetYAML()static StringprepareString(String input)static org.json.JSONObjecttoJSON(Info info)static org.json.JSONObjecttoJSON(ArraySchema arraySchema)static org.json.JSONObjecttoJSON(ExampleObject example)static org.json.JSONObjecttoJSON(Schema schema)static org.json.JSONObjecttoJSON(SchemaProperty[] properties)static org.json.JSONObjecttoJSON(Parameter p)
-
-
-
Method Detail
-
asYaml
public static String asYaml(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
- Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionIOException
-
getYAML
public static String getYAML() throws IOException
- Throws:
IOException
-
create
public static void create(HashSet<Class<? extends jakarta.servlet.http.HttpServlet>> pservlets)
-
toJSON
public static org.json.JSONObject toJSON(Info info)
-
getJSON
public static org.json.JSONObject getJSON()
-
checkExamples
public static Tuple checkExamples()
used to check if the examples are all correct- Returns:
-
add
public static void add(String tag, OAuthFlows flows, org.json.JSONObject json)
-
add
public static void add(Tag tag, org.json.JSONArray array)
-
add
public static void add(ApiEndpoint endpoint, Operation operation, Method method, org.json.JSONObject paths)
-
toJSON
public static org.json.JSONObject toJSON(ArraySchema arraySchema)
-
createJSONSchemaFromSchema
public static org.json.JSONObject createJSONSchemaFromSchema(org.json.JSONObject schema)
-
checkExample
public static boolean checkExample(String value, org.json.JSONObject schema, SchemaType type)
-
checkExample
public static boolean checkExample(ExampleObject e, org.json.JSONObject schema, SchemaType type)
-
toJSON
public static org.json.JSONObject toJSON(Parameter p)
-
add
public static void add(Parameter p, org.json.JSONArray params)
-
toJSON
public static org.json.JSONObject toJSON(SchemaProperty[] properties)
-
add
public static void add(String tag, SchemaProperty[] properties, org.json.JSONObject json)
-
toJSON
public static org.json.JSONObject toJSON(ExampleObject example)
-
add
public static void add(String tag, ExampleObject[] examples, org.json.JSONObject json)
-
toJSON
public static org.json.JSONObject toJSON(Schema schema)
-
add
public static void add(String tag, DiscriminatorMapping[] value, org.json.JSONObject json)
-
add
public static void add(String tag, ExternalDocumentation value, org.json.JSONObject json)
-
add
public static void add(String tag, double value, org.json.JSONObject json, Double ignoreIfThis)
-
add
public static void add(String tag, boolean value, org.json.JSONObject json, Boolean ignoreIfThis)
-
add
public static void add(String tag, org.json.JSONObject values, org.json.JSONObject json)
-
add
public static void add(String tag, org.json.JSONArray values, org.json.JSONObject json)
-
-