Class OpenAPIUtils
java.lang.Object
com.atlassian.crowd.maven.plugin.openapi.OpenAPIUtils
Utility class for working with OpenAPI objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSerializes the entries of a map in a sorted order. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.swagger.v3.oas.models.OpenAPIaddTagsToRoot(io.swagger.v3.oas.models.OpenAPI openAPI) Adds tags to the root of an OpenAPI object, extracted from the existing tags on operationsstatic io.swagger.v3.oas.models.OpenAPImergeOpenAPI(io.swagger.v3.oas.models.OpenAPI api1, io.swagger.v3.oas.models.OpenAPI api2) static io.swagger.v3.oas.models.OpenAPIprocessNarrative(io.swagger.v3.oas.models.OpenAPI openAPI, String docFilesRoot) Processes the x-atlassian-narrative extension in an OpenAPI object.static voidwriteOpenAPIToFile(io.swagger.v3.oas.models.OpenAPI mergedOpenAPI, String outputFile) Overload forwriteOpenAPIToFile(OpenAPI, String, boolean)where format is enabled by default.static voidwriteOpenAPIToFile(io.swagger.v3.oas.models.OpenAPI mergedOpenAPI, String outputFile, boolean formatted) Writes an OpenAPI object to a file.
-
Field Details
-
X_ATLASSIAN_NARRATIVE
- See Also:
-
-
Constructor Details
-
OpenAPIUtils
public OpenAPIUtils()
-
-
Method Details
-
mergeOpenAPI
public static io.swagger.v3.oas.models.OpenAPI mergeOpenAPI(io.swagger.v3.oas.models.OpenAPI api1, io.swagger.v3.oas.models.OpenAPI api2) throws IntrospectionException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException -
writeOpenAPIToFile
public static void writeOpenAPIToFile(io.swagger.v3.oas.models.OpenAPI mergedOpenAPI, String outputFile) Overload forwriteOpenAPIToFile(OpenAPI, String, boolean)where format is enabled by default. -
writeOpenAPIToFile
public static void writeOpenAPIToFile(io.swagger.v3.oas.models.OpenAPI mergedOpenAPI, String outputFile, boolean formatted) Writes an OpenAPI object to a file. The file extension must be .yaml, .yml, or .json.- Parameters:
mergedOpenAPI- the OpenAPI objectoutputFile- the file path
-
processNarrative
public static io.swagger.v3.oas.models.OpenAPI processNarrative(io.swagger.v3.oas.models.OpenAPI openAPI, String docFilesRoot) Processes the x-atlassian-narrative extension in an OpenAPI object.- Parameters:
openAPI- the OpenAPI object- Returns:
- the processed OpenAPI object
-
addTagsToRoot
public static io.swagger.v3.oas.models.OpenAPI addTagsToRoot(io.swagger.v3.oas.models.OpenAPI openAPI) Adds tags to the root of an OpenAPI object, extracted from the existing tags on operations- Parameters:
openAPI- the OpenAPI object- Returns:
- the OpenAPI object with tags added
-