swapi-typespec

1.0.0-alpha.1 • Public • Published

SWAPI TypeSpec

TypeSpec representation of SWAPI: The Star Wars API.

CI Build npm version

About

I created this project to learn about TypeSpec through first-hand usage.

The generated Open API 3 specification has 878 lines (with no blank lines) in a single file. The TypeSpec source has 493 lines (about ⅓ are blank lines for readability) split across 8 files for logical organization, which is a ~45% reduction in lines of code.

If we ignore the imports, using statements, and blank lines within models, then the TypeSpec only has 353 lines. That means a 60% reduction in code to maintain.

Getting started

Follow these steps to consume the generated Open API specification for SWAPI.

  1. Install this package as a dependency.

    npm install -D swapi-typespec
  2. Reference the generated Open API specification directly.

    ./node_modules/swapi-typespec/swapi.openapi.yaml

Package Sidebar

Install

npm i swapi-typespec

Weekly Downloads

0

Version

1.0.0-alpha.1

License

MIT

Unpacked Size

30 kB

Total Files

5

Last publish

Collaborators

  • connorjs