public interface Reference<T extends Reference<T>>
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getRef()
Returns the reference property from this Reference instance.
|
default T |
ref(java.lang.String ref)
Sets this Reference's reference property to the given string.
|
void |
setRef(java.lang.String ref)
Sets this Reference's reference property to the given string.
|
java.lang.String getRef()
void setRef(java.lang.String ref)
Normally a full reference string is a JSON pointer RFC6901 which indicates an object definition in the components section of the current OpenAPI document. For example the schema of a request body may be #/components/schemas/Payload or the definition of a parameter could be #/components/parameters/Routing.HostName.
If you provide a short name then the name will automatically be expanded to the appropriate full reference string. A short name is a string which is not a JSON pointer in that it does not contain a "/".
The appropriate full reference is determined by the context. For a parameter the short name will be prefixed by "#/components/parameters/" to create "#/components/parameters/ShortName".
parameter.setRef("ShortName"); // #/components/parameters/ShortName
For a response the prefix is "#/components/responses/":
response.setRef("NotFound"); // #/components/responses/NotFound
This property provides a reference to an object defined elsewhere. This property and all other properties are mutually exclusive. If other properties are defined in addition to the reference property then the result is undefined.
ref
- a reference to a T object in the components section of this OpenAPI document
or a JSON pointer to another document.default T ref(java.lang.String ref)
ref
- a reference to a T object in the components in this OpenAPI document