Class OpenAPIGeneratorMetadata

java.lang.Object
org.brapi.schematools.core.openapi.generator.metadata.OpenAPIGeneratorMetadata
All Implemented Interfaces:
Metadata, Validatable

public class OpenAPIGeneratorMetadata extends Object implements Metadata
Provides metadata for the OpenAPI generation
  • Constructor Details

    • OpenAPIGeneratorMetadata

      public OpenAPIGeneratorMetadata()
  • Method Details

    • load

      public static OpenAPIGeneratorMetadata load()
      Load the default metadata
      Returns:
      The default metadata
    • load

      public static OpenAPIGeneratorMetadata load(Path metadataFile) throws IOException
      Load the metadata from a metadata file in YAML or Json. The metadata file may have missing (defined) values, in these cases the default values are loaded. See load()
      Parameters:
      metadataFile - The path to the metadata file in YAML or Json.
      Returns:
      The metadata loaded from the YAML or Json file.
      Throws:
      IOException - if the metadata file can not be found or is incorrectly formatted.
    • load

      public static OpenAPIGeneratorMetadata load(InputStream inputStream) throws IOException
      Load the metadata from an metadata input stream in YAML or Json. The metadata file may have missing (defined) values, in these cases the default values are loaded. See load()
      Parameters:
      inputStream - The input stream in YAML or Json.
      Returns:
      The metadata loaded from input stream.
      Throws:
      IOException - if the input stream is not valid or the content is incorrectly formatted.
    • override

      public OpenAPIGeneratorMetadata override(OpenAPIGeneratorMetadata overrideMetadata)
      Overrides the values in this Options Object from the provided Options Object if they are non-null
      Parameters:
      overrideMetadata - the options which will be used to override this Options Object
      Returns:
      this options for method chaining
    • getTitleFor

      public String getTitleFor(String name)
      Gets the specification title for a specification generated for a module or class
      Parameters:
      name - the name of the module or class
      Returns:
      the title for a specification generated for a module or class, or the default title
    • setTitleFor

      public OpenAPIGeneratorMetadata setTitleFor(String name, String title)
      Sets the specification title for a specification generated for a module or class
      Parameters:
      name - the name of the module or class
      title - the title for a specification generated for a module or class
      Returns:
      the options for chaining