Class AwsRestJson1Protocol
- java.lang.Object
-
- software.amazon.smithy.openapi.fromsmithy.protocols.AwsRestJson1Protocol
-
- All Implemented Interfaces:
OpenApiProtocol<RestJson1Trait>
public final class AwsRestJson1Protocol extends java.lang.Object
Converts theaws.protocols#restJson1
protocol to OpenAPI.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface software.amazon.smithy.openapi.fromsmithy.OpenApiProtocol
OpenApiProtocol.Operation
-
-
Constructor Summary
Constructors Constructor Description AwsRestJson1Protocol()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<OpenApiProtocol.Operation>
createOperation(Context<T> context, OperationShape operation)
Creates an operation entry, including the method, URI, and operation object builder.protected java.lang.String
getEventStreamMediaType(Context<T> context, EventStreamInfo info)
Gets the media type of an event stream for the protocol.java.lang.Class<RestJson1Trait>
getProtocolType()
Gets the protocol type that this converter handles.void
updateDefaultSettings(Model model, OpenApiConfig config)
Sets protocol-specific default values on the OpenAPI configuration object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.openapi.fromsmithy.OpenApiProtocol
getOperationMethod, getOperationResponseStatusCode, getOperationUri, getProtocolRequestHeaders, getProtocolResponseHeaders
-
-
-
-
Method Detail
-
getProtocolType
public java.lang.Class<RestJson1Trait> getProtocolType()
Description copied from interface:OpenApiProtocol
Gets the protocol type that this converter handles.- Returns:
- Returns the shape ID.
-
updateDefaultSettings
public void updateDefaultSettings(Model model, OpenApiConfig config)
Description copied from interface:OpenApiProtocol
Sets protocol-specific default values on the OpenAPI configuration object.- Parameters:
model
- Model being converted.config
- Configuration object to modify.
-
createOperation
public java.util.Optional<OpenApiProtocol.Operation> createOperation(Context<T> context, OperationShape operation)
Description copied from interface:OpenApiProtocol
Creates an operation entry, including the method, URI, and operation object builder.The operation is returned as an empty Optional if the operation is not supported by the protocol. This method should make calls to
OpenApiProtocol.getOperationUri(software.amazon.smithy.openapi.fromsmithy.Context<T>, software.amazon.smithy.model.shapes.OperationShape)
andOpenApiProtocol.getOperationMethod(software.amazon.smithy.openapi.fromsmithy.Context<T>, software.amazon.smithy.model.shapes.OperationShape)
when creating the Operation object.- Specified by:
createOperation
in interfaceOpenApiProtocol<T extends Trait>
- Parameters:
context
- The build context.operation
- The operation shape to create.- Returns:
- Returns the optionally created operation entry.
-
getEventStreamMediaType
protected java.lang.String getEventStreamMediaType(Context<T> context, EventStreamInfo info)
Gets the media type of an event stream for the protocol.By default, this method returns the binary AWS event stream media type,
application/vnd.amazon.eventstream
.- Parameters:
context
- Conversion context.info
- Event stream info to provide the media type for.- Returns:
- Returns the media type of the event stream.
-
-