Norway Porridge Makers

    @cadl-lang/openapi3
    TypeScript icon, indicating that this package has built-in type declarations

    0.11.0 • Public • Published

    Cadl OpenAPI 3.0 Emitter

    This package provides the Cadl emitter to produce OpenAPI 3.0 output from Cadl source.

    Install

    In your cadl project root

    npm install @cadl-lang/openapi3

    Emit OpenAPI 3.0 spec

    1. Via the command line
    cadl compile . --emit @cadl-lang/openapi3
    1. Via the config

    Add the following to the cadl-project.yaml file.

    emitters:
      @cadl-lang/openapi3: true

    Use OpenAPI 3.0 specific decorators:

    import "@cadl-lang/openapi3";
    
    using OpenAPI.V3;
    
    // Using `using`
    @useRef("common.json#/components/schemas/Foo")
    model Foo {}
    
    // Using fully qualified names
    @OpenAPI.V3.oneOf
    union MyUnion {
      cat: Cat,
      dog: Dog,
    }
    
    

    See also

    Keywords

    Install

    npm i @cadl-lang/openapi3@0.11.0

    Version

    0.11.0

    License

    MIT

    Unpacked Size

    97.4 kB

    Total Files

    27

    Last publish

    Collaborators

    • azure-sdk