Lint on generate success. Move YAML file to src/schema/
Signed-off-by: Aramis Sennyey <sennyeya@amazon.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
1f5800ae6d
commit
ef770923df
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user