@CompileStatic class SchemaNames extends java.lang.Object
Keeps each schema name in a document to one thing.
swagger-core names a class by its simple name, so two classes sharing a simple name in different packages would be described by one schema, and a class sharing the name of a schema the document already has or derives, such as the validation errors, would stand in for it.
A name more than one class claims is taken by none of them: each is named by the package it is declared in as well, whichever is described first, so the names do not depend on the order the document is described in. A reserved name keeps its schema, and a class claiming it is named by its package.
While a document is described, the first to claim a name holds it and a later claimant is given its qualified name. renames then says which names to move once the document is complete.
| Constructor and description |
|---|
SchemaNames() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String |
claim(com.fasterxml.jackson.databind.JavaType type, java.lang.String natural)
|
|
static boolean |
isDescribedAsItself(io.swagger.v3.core.converter.AnnotatedType annotatedType, com.fasterxml.jackson.databind.JavaType type)Whether swagger-core describes the type as itself, rather than another in its place: the implementation or the primitive type a @Schema annotation names, or the value a
@JsonValue accessor returns, which is resolved under the name the type was given. |
|
static boolean |
isNamed(io.swagger.v3.core.converter.AnnotatedType annotatedType, com.fasterxml.jackson.databind.JavaType type)Whether swagger-core describes the type as a schema of its own, which is named, rather than inline. |
|
java.lang.String |
move(java.lang.String reserved, java.lang.String target)Claims the name a reserved schema moves to once the document is complete, such as a patch schema following the schema it is a patch of, apart from any class that holds it. |
|
static java.lang.String |
naturalName(io.swagger.v3.core.converter.AnnotatedType annotatedType, com.fasterxml.jackson.databind.JavaType type)The name swagger-core gives the type: the name a @Schema annotation declares, the
root name Jackson declares, or the simple name. |
|
java.util.Map<java.lang.String, java.lang.String> |
renames()The names to move once the document is complete: each class holding a name something else also claims moves to its qualified name, and each schema a class kept from its reserved name moves to it. |
|
java.lang.String |
reserve(java.lang.String name)Reserves a name for a schema that is not resolved from a class: one the document already has, or one it derives. |
|
java.lang.String |
reserve(java.lang.String name, java.lang.Class<?> resolvedFrom)Keeps a name the document already has for the class its schema was resolved from, as springdoc resolves a class one of its endpoints returns, so the class is described by that schema, under its name, rather than apart from it. |
| 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 swagger-core describes the type as itself, rather than another in its place: the
implementation or the primitive type a @Schema annotation names, or the value a
@JsonValue accessor returns, which is resolved under the name the type was given. An
enum is described as itself whatever it is serialized as, its values read from its
@JsonValue accessor where it has one.
Whether swagger-core describes the type as a schema of its own, which is named, rather than
inline. An enum is described inline unless it is described as a schema of its own, by
@Schema(enumAsRef = true) or swagger-core's configuration.
Claims the name a reserved schema moves to once the document is complete, such as a patch schema following the schema it is a patch of, apart from any class that holds it.
The name swagger-core gives the type: the name a @Schema annotation declares, the
root name Jackson declares, or the simple name.
The names to move once the document is complete: each class holding a name something else also claims moves to its qualified name, and each schema a class kept from its reserved name moves to it.
Reserves a name for a schema that is not resolved from a class: one the document already has, or one it derives.
Keeps a name the document already has for the class its schema was resolved from, as springdoc resolves a class one of its endpoints returns, so the class is described by that schema, under its name, rather than apart from it.
resolvedFrom - the class, or null where it is not known