Interface MediaTypeRegistration
public interface MediaTypeRegistration
A MediaTypeRegistration is used to register mediatypes to the openapi mediatype registry. It consists of a predicate
that checks if a media type can be handled by the created content analysers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MediaTypeRegistrationstatic final MediaTypeRegistrationstatic final MediaTypeRegistrationstatic final MediaTypeRegistrationstatic final MediaTypeRegistrationstatic final MediaTypeRegistration -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this registration can handle the given media type.createContentAnalyser(String contentType, Buffer content, ValidationContext context) Creates a newContentAnalyser.This method is intended for reporting of supported media types in the system.
-
Field Details
-
APPLICATION_JSON
-
MULTIPART_FORM_DATA
-
TEXT_PLAIN
-
APPLICATION_OCTET_STREAM
-
APPLICATION_X_WWW_FORM_URL_ENCODED
-
VENDOR_SPECIFIC_JSON
-
-
Method Details
-
createContentAnalyser
ContentAnalyser createContentAnalyser(String contentType, Buffer content, ValidationContext context) Creates a newContentAnalyser. This is required, becauseContentAnalysercould be stateful.- Parameters:
contentType- The raw content type from the http headers.content- The content of the request or response.context- Whether the analyser is for a request or response.- Returns:
- A fresh content analyser instance.
-
canHandle
Checks if this registration can handle the given media type. This method is intended to be used by the MediaTypeRegistry.- Parameters:
mediaType- The media type to check- Returns:
- true if the mediatype can be handled, false otherwise
-
supportedTypes
-