Interface OpenApiMapper

    • Method Detail

      • getOrder

        default byte getOrder()
        Gets the sort order of the plugin from -128 to 127.

        Plugins are applied according to this sort order. Lower values are executed before higher values (for example, -128 comes before 0, comes before 127). Plugins default to 0, which is the middle point between the minimum and maximum order values.

        Returns:
        Returns the sort order, defaulting to 0.
      • updateOperation

        default OperationObject updateOperation​(Context<? extends Trait> context,
                                                OperationShape shape,
                                                OperationObject operation,
                                                java.lang.String httpMethodName,
                                                java.lang.String path)
        Updates an operation.
        Parameters:
        context - Conversion context.
        shape - Operation being converted.
        operation - OperationObject being built.
        httpMethodName - The HTTP method of the operation.
        path - The HTTP URI of the operation.
        Returns:
        Returns the updated operation object.
      • updatePathItem

        default PathItem updatePathItem​(Context<? extends Trait> context,
                                        java.lang.String path,
                                        PathItem pathItem)
        Updates a path item.
        Parameters:
        context - Conversion context.
        path - Path of the PathItem.
        pathItem - Path item being converted.
        Returns:
        Returns the updated path item.
      • updateParameter

        default ParameterObject updateParameter​(Context<? extends Trait> context,
                                                OperationShape operation,
                                                java.lang.String httpMethodName,
                                                java.lang.String path,
                                                ParameterObject parameterObject)
        Updates a parameter.
        Parameters:
        context - Conversion context.
        operation - Smithy operation being converted.
        httpMethodName - The HTTP method that this parameter is bound to.
        path - The HTTP URI this parameter is bound to.
        parameterObject - Parameter being updated.
        Returns:
        Returns the updated parameter.
      • updateRequestBody

        default RequestBodyObject updateRequestBody​(Context<? extends Trait> context,
                                                    OperationShape operation,
                                                    java.lang.String httpMethodName,
                                                    java.lang.String path,
                                                    RequestBodyObject requestBody)
        Updates the request body of an operation.
        Parameters:
        context - Conversion context.
        operation - Operation being converted.
        httpMethodName - The HTTP method that this request is bound to.
        path - The HTTP URI this request is bound to.
        requestBody - Request body being updated.
        Returns:
        Returns the updated request body.
      • updateResponse

        default ResponseObject updateResponse​(Context<? extends Trait> context,
                                              OperationShape operation,
                                              java.lang.String status,
                                              java.lang.String httpMethodName,
                                              java.lang.String path,
                                              ResponseObject response)
        Updates a response object.
        Parameters:
        context - Conversion context.
        operation - Operation shape being converted.
        status - HTTP status of this response.
        httpMethodName - The HTTP method that this response responds to.
        path - The HTTP URI this response responds to.
        response - Response object being updated.
        Returns:
        Returns the updated response object.
      • before

        default void before​(Context<? extends Trait> context,
                            OpenApi.Builder builder)
        Updates an OpenApi.Builder before converting the model.
        Parameters:
        context - Conversion context.
        builder - OpenAPI builder to modify.
      • updateSecurityScheme

        default SecurityScheme updateSecurityScheme​(Context<? extends Trait> context,
                                                    Trait authTrait,
                                                    SecurityScheme securityScheme)
        Updates a security scheme object.
        Parameters:
        context - Conversion context.
        authTrait - Smithy authentication scheme trait.
        securityScheme - Security scheme object to update.
        Returns:
        Returns the updated security scheme object. Return null to remove the scheme.
      • updateSecurity

        default java.util.Map<java.lang.String,​java.util.List<java.lang.String>> updateSecurity​(Context<? extends Trait> context,
                                                                                                      Shape shape,
                                                                                                      SecuritySchemeConverter<? extends Trait> converter,
                                                                                                      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> requirement)
        Updates a security requirement map.

        The provided requirement Map will never be null or empty, but it may contain more than one key-value pair. A null or empty return value will cause the security requirement to be omitted from the converted shape.

        Parameters:
        context - Conversion context.
        shape - Shape that is getting a security requirement (a service or operation).
        converter - Security scheme converter.
        requirement - Security scheme requirement to update.
        Returns:
        Returns the updated security requirement, a mapping of scheme to requirements.
      • after

        default OpenApi after​(Context<? extends Trait> context,
                              OpenApi openapi)
        Updates an OpenApi object after it is built.
        Parameters:
        context - Conversion context.
        openapi - OpenAPI object to modify.
        Returns:
        Returns the updated OpenApi object.
      • updateNode

        default ObjectNode updateNode​(Context<? extends Trait> context,
                                      OpenApi openapi,
                                      ObjectNode node)
        Modifies the Node/JSON representation of an OpenAPI object.
        Parameters:
        context - Conversion context.
        openapi - OpenAPI object being converted to a node.
        node - OpenAPI object node.
        Returns:
        Returns the updated ObjectNode.
      • compose

        static OpenApiMapper compose​(java.util.List<OpenApiMapper> mappers)
        Creates an OpenApiMapper that is composed of multiple mappers.
        Parameters:
        mappers - Mappers to compose.
        Returns:
        Returns the composed mapper.