Interface RequestBody
- All Superinterfaces:
OpenAPIObject
This interface represents the most important attributes of an OpenAPI Operation.
Operation V3.1
Operation V3.0
Operation V3.1
Operation V3.0
-
Method Summary
Modifier and TypeMethodDescriptiondetermineContentType(String mediaTypeIdentifier) This method tries to determine the best fittingMediaTypebased on the passed content type.booleanMethods inherited from interface OpenAPIObject
getExtensions, getOpenAPIModel
-
Method Details
-
isRequired
boolean isRequired()- Returns:
- true if the request body is required in the request, otherwise false.
-
getContent
-
determineContentType
This method tries to determine the best fittingMediaTypebased on the passed content type.
This is necessary, to avoid that an incoming request of type application/json; charset=utf-8 is failing, because we only declared application/json in the OpenAPI spec.
Important: If application/json is declared in the contract, application/json; charset=utf-8 would fit, but not the other way around.- Returns:
- A fitting media type, or null.
-