Lint on generate success. Move YAML file to src/schema/

Signed-off-by: Aramis Sennyey <sennyeya@amazon.com>
This commit is contained in:
Aramis Sennyey
2023-04-03 12:22:50 -04:00
committed by Fredrik Adelöw
parent 1f5800ae6d
commit ef770923df
11 changed files with 48 additions and 24 deletions
+2 -2
View File
@@ -8,13 +8,13 @@ This package is meant to provide a typed Express router for an OpenAPI spec. Bas
### Configuration
1. Run `yarn --cwd <package-dir> backstage-cli package schema:openapi:generate` to translate your `openapi.yaml` to a new Typescript file in `schema/openapi.ts`. In the case of projects that require linting + a license header, you will need to do this manually.
1. Run `yarn --cwd <package-dir> backstage-cli package schema:openapi:generate` to translate your `src/schema/openapi.yaml` to a new Typescript file in `src/schema/openapi.ts`. In the case of projects that require linting + a license header, you will need to do this manually.
2. In your plugin's `src/service/createRouter.ts`,
```ts
import {ApiRouter} from `@backstage/backend-openapi-utils`;
import spec from '../../schema/openapi'
import spec from '../schema/openapi'
...
export function createRouter(){