@CompileStatic class GrailsOpenApiGenerator extends java.lang.Object
Generates an OpenAPI description of a Grails application from its URL mappings, its controllers and its GORM mapping context.
The generator depends on nothing but the application, so the same description is produced
at build time by the generate-open-api command and at runtime by springdoc, which this
module contributes the description to when springdoc is on the classpath.
| Type | Name and description |
|---|---|
static java.lang.String |
VALIDATION_ERRORS_SCHEMAThe schema describing the validation errors Grails renders when a request cannot be bound. |
| Constructor and description |
|---|
GrailsOpenApiGenerator(GrailsApplication grailsApplication, UrlMappingsHolder urlMappingsHolder, java.util.Collection<MappingContext> mappingContexts, OpenApiSettings settings)
|
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
contribute(io.swagger.v3.oas.models.OpenAPI openApi, OpenApiSelection selection)Adds the described operations, and the base document when one is configured, to a document something else has started, such as springdoc. |
|
io.swagger.v3.oas.models.OpenAPI |
generate()
|
|
io.swagger.v3.oas.models.OpenAPI |
generate(java.lang.String group)
|
|
io.swagger.v3.oas.models.OpenAPI |
generate(OpenApiSelection selection)
|
|
OpenApiSettings |
getSettings()
|
|
static java.lang.String |
serialize(io.swagger.v3.oas.models.OpenAPI openApi, java.lang.String format)Writes a document in the format named: json, or YAML otherwise. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
The schema describing the validation errors Grails renders when a request cannot be bound.
grailsApplication - the application whose controllers are describedurlMappingsHolder - the URL mappings whose paths are describedmappingContexts - the GORM mapping contexts whose entities are described, which may be
empty in an application without GORMsettings - what to describeAdds the described operations, and the base document when one is configured, to a document something else has started, such as springdoc.
openApi - the document to add toselection - what the document selects, or null for everything
group - the name of a group configured under grails.openapi.groups
Writes a document in the format named: json, or YAML otherwise.