@CompileStatic class GrailsModelConverter extends java.lang.Object implements io.swagger.v3.core.converter.ModelConverter
Teaches swagger-core what a Groovy class, a command object and a GORM entity look like, so the schema of such a type is right wherever it is resolved: as a resource, as a command object, or as the implementation an annotation names.
metaClass every Groovy object has, and the errors a validateable type
has, are not properties of the resource and are left out.The converter is registered with swagger-core once, and describes a type so only where a Grails description is resolving it, which supplies the GORM metadata it uses through withMappingContexts. Anywhere else, as springdoc resolves the types of its own endpoints, which Jackson renders rather than Grails, it passes the type on as it is, and records, while springdoc builds a document, the class it resolves under each name. A declaration that cannot be read, such as constraints that fail to evaluate, is left out, and logged; each is read before the schema is changed.
| Type | Name and description |
|---|---|
static GrailsModelConverter |
INSTANCE |
| Constructor and description |
|---|
GrailsModelConverter() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static PersistentEntity |
entityFor(java.lang.Class<?> type)
|
|
static boolean |
hasFileProperty(java.lang.Class<?> type)Whether a type has a property a file is bound to, so it is bound from a multipart request. |
|
static io.swagger.v3.oas.annotations.media.Schema |
identifierSchema(PersistentEntity entity)The schema of the identifier an entity is addressed and associated by: an integer of the width it is declared with, a UUID, or a string for any other type. |
|
static void |
recordResolvedNames()Starts recording the class resolved under each name outside a Grails description on this thread, as springdoc starts building a document, before it resolves the types of its own endpoints. |
|
static void |
register()Registers the converter with both of swagger-core's converter lists, once. |
|
io.swagger.v3.oas.annotations.media.Schema |
resolve(io.swagger.v3.core.converter.AnnotatedType annotatedType, io.swagger.v3.core.converter.ModelConverterContext context, java.util.Iterator<io.swagger.v3.core.converter.ModelConverter> chain) |
|
static java.util.Map<java.lang.String, java.lang.Class<?>> |
takeResolvedNames()Stops recording, as the Grails description of a document springdoc builds starts. |
<T> |
static T |
withMappingContexts(java.util.Collection<MappingContext> mappingContexts, Closure<T> work)Resolves with the entities of the given mapping contexts known, so their constraints, identifiers and associations are described. |
<T> |
static T |
withMappingContexts(java.util.Collection<MappingContext> mappingContexts, boolean includeVersion, Closure<T> work)
|
<T> |
static T |
withSchemaNames(SchemaNames names, Closure<T> work)Resolves with every class named apart from the others sharing its name, through the names of the document being described. |
<T> |
static T |
withTypesOnly(Closure<T> work)Resolves the types a description reaches without reading what Grails declares of them, as a build processing the application ahead of time does, while the application is not running. |
| 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) |
Whether a type has a property a file is bound to, so it is bound from a multipart request.
The schema of the identifier an entity is addressed and associated by: an integer of the width it is declared with, a UUID, or a string for any other type.
Starts recording the class resolved under each name outside a Grails description on this thread, as springdoc starts building a document, before it resolves the types of its own endpoints. What an earlier document recorded is dropped.
Registers the converter with both of swagger-core's converter lists, once.
Stops recording, as the Grails description of a document springdoc builds starts.
Resolves with the entities of the given mapping contexts known, so their constraints, identifiers and associations are described.
includeVersion - whether Grails renders the version of an entity, which it does not
unless grails.converters.domain.include.version is setResolves with every class named apart from the others sharing its name, through the names of the document being described.
Resolves the types a description reaches without reading what Grails declares of them, as a build processing the application ahead of time does, while the application is not running.