Class OpenAPIGenerator

java.lang.Object
com.codingchili.core.protocol.OpenAPIGenerator

public class OpenAPIGenerator extends Object
Template for generating valid OpenAPI 3 definitions, see https://apidevtools.org/swagger-parser/online/
  • Constructor Details

    • OpenAPIGenerator

      public OpenAPIGenerator()
  • Method Details

    • toYaml

      public static String toYaml(Protocol<?> protocol)
      Parameters:
      protocol - the protocol instance to generate an API definition from.
      Returns:
      a YAML OpenAPI v3 schema generated from a protocol.
      See Also:
      toJson(Protocol)
    • toJson

      public static String toJson(Protocol<?> protocol)
      Generates OpenAPI v3 compatible definitions from the given protocol. The information is retrieved using protocol metadata, registered using the documentation API or with protocol annotations. Reflection may also be used to retrieve additional information.
      Parameters:
      protocol - the protocol instance to generate an API definition from.
      Returns:
      a YAML OpenAPI v3 schema generated from a protocol.
    • main

      public static void main(String[] args)