Class RemoveEmptyComponents

  • All Implemented Interfaces:
    OpenApiMapper

    public final class RemoveEmptyComponents
    extends java.lang.Object
    implements OpenApiMapper
    Removes empty key-value pairs in the "components" of a model if empty, and removes the "components" key-value pair of a model if it is empty.
    • Constructor Detail

      • RemoveEmptyComponents

        public RemoveEmptyComponents()
    • Method Detail

      • getOrder

        public byte getOrder()
        Description copied from interface: OpenApiMapper
        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.

        Specified by:
        getOrder in interface OpenApiMapper
        Returns:
        Returns the sort order, defaulting to 0.
      • updateNode

        public ObjectNode updateNode​(Context<? extends Trait> context,
                                     OpenApi openapi,
                                     ObjectNode node)
        Description copied from interface: OpenApiMapper
        Modifies the Node/JSON representation of an OpenAPI object.
        Specified by:
        updateNode in interface OpenApiMapper
        Parameters:
        context - Conversion context.
        openapi - OpenAPI object being converted to a node.
        node - OpenAPI object node.
        Returns:
        Returns the updated ObjectNode.