0.7.0 • Published 14 days ago

@autorest/openapi-to-typespec v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

Autorest openapi-to-typespec Plugin Configuration

Autorest extension to scaffold a new TypeSpec definition from an existing OpenApi document.

To run it

autorest --openapi-to-typespec --input-file=<path-to-swagger> --namespace=<namespace> --title="<ProjectName>" --use=@autorest/openapi-to-typespec@next --output-folder=.

or with a README config file

autorest --openapi-to-typespec --require=<path-to-readme-config>.md --use=@autorest/openapi-to-typespec@next --output-folder=.

This plugin will generate the following files

main.tsp - Entry point of the TypeSpec project, it contains service information models.tsp - Contains all the model definitions routes.tsp - Contains all the resource endpoints tsproject.yaml - Contains configuration for the TypeSpec compiler package.json - Configuration of the TypeSpec project

version: 3.6.6
use-extension:
  "@autorest/modelerfour": "^4.23.5"

modelerfour:
  # this runs a pre-namer step to clean up names
  prenamer: false

openapi-to-typespec-scope/emitter:
  input-artifact: openapi-to-typespec-files

output-artifact: openapi-to-typespec-files

pipeline:
  source-swagger-detector:
    input: openapi-document/multi-api/identity
  openapi-to-typespec: # <- name of plugin
    input:
      - modelerfour/identity
      - source-swagger-detector
    output-artifact: openapi-to-typespec-files

  openapi-to-typespec/emitter:
    input: openapi-to-typespec
    scope: openapi-to-typespec-scope/emitter