Generates schemas for Polaris types.

Important: Does not work in a webpack bundled application with no external dependencies, because the ECMAScript .d.ts files included with TypeScript would not be bundled by default. Thus, ts-json-schema-generator and typescript must be external dependencies (i.e., installed in node_modules).

Hierarchy

  • SchemaGenerator

Constructors

Methods

  • Generates an orchestrator-specific JSON Schema for a Polaris type.

    Parameters

    • config: SchemaGeneratorConfig

      Specifies which TypeScript project to inspect and which type to generate the schema for.

    Returns Promise<JsonSchema>

    A JSON Schema for the specified type that has been transformed for the current orchestrator or throws an error if the type cannot be found or in case of other problems.

  • Generates an OpenAPI v3 Schema for a Polaris type.

    Parameters

    • config: SchemaGeneratorConfig

      Specifies which TypeScript project to inspect and which type to generate the schema for.

    Returns Promise<BaseSchemaObject>

    An OpenApiSchema for the specified type or throws an error if the type cannot be found or in case of other problems.

    Note

    This does not generate a complete OpenAPI spec, which would describe an entire API. Instead only a schema that describes a single type is generated.

Generated using TypeDoc