Package io.micronaut.gradle.openapi
Class ParameterMappingModel
java.lang.Object
io.micronaut.gradle.openapi.ParameterMappingModel
- All Implemented Interfaces:
Serializable
A model that can be used to specify parameter mappings during the OpenAPI generation
An equivalent to Micronaut OpenAPI's ParameterMapping but without using classes from that dependency so that we can isolate execution in workers.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum used to describe the location of a parameter. -
Constructor Summary
ConstructorDescriptionParameterMappingModel
(String name, ParameterMappingModel.ParameterLocation location, String mappedType) Create a parameter mapping -
Method Summary
Modifier and TypeMethodDescriptiongetName()
boolean
Specify the location of the parameter that triggers the mapping.withMappedName
(String mappedName) Specify the unique name of the parameter to be used as method parameter name.withMappedType
(String mappedType) Specify the fully-qualified type to which the parameter will be mapped .Specify the name of the parameter to trigger the mapping.withValidated
(boolean isValidated) Specify whether the parameter requires validation.
-
Constructor Details
-
ParameterMappingModel
public ParameterMappingModel(String name, ParameterMappingModel.ParameterLocation location, String mappedType) Create a parameter mapping- Parameters:
name
- The name of the parameter as described by the name field in specification.location
- The location of parameter. Path parameters cannot be mapped, as this behavior should not be used.mappedType
- The type to which the parameter should be mapped. If multiple parameters have the same mapping, only one parameter will be present. If set to null, the original parameter will simply be deleted. The type should contain the package name if required.
-
-
Method Details
-
withName
Specify the name of the parameter to trigger the mapping. The name should correspond to a field name in the OpenAPI specification.- Parameters:
name
- the name- Returns:
- new instance with the updated name
-
withLocation
Specify the location of the parameter that triggers the mapping.- Parameters:
location
- the name- Returns:
- new instance with the updated location
-
withMappedType
Specify the fully-qualified type to which the parameter will be mapped .- Parameters:
mappedType
- the type- Returns:
- new instance with the updated mapped type
-
withMappedName
Specify the unique name of the parameter to be used as method parameter name.- Parameters:
mappedName
- the name- Returns:
- new instance with the name specified
-
withValidated
Specify whether the parameter requires validation.- Parameters:
isValidated
- the value- Returns:
- new instance with the validation requirement specified
-
getName
-
getLocation
-
getMappedType
-
getMappedName
-
isValidated
public boolean isValidated()
-