Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-745

Let backend-openapi-utils be used from subfolder

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • None
    • None

      To create an express router that uses openapi spec we want to use backend-openapi-utils plugin.

      The readme is outdated/wrong.
      The command `yarn --cwd <package-dir> backstage-cli package schema openapi generate` doesn't work.
      What it is necessary to do is `yarn add @backstage/repo-tools` and then `yarn backstage-repo-tools schema openapi generate`.
      This plugin accepts only `openapi.yaml` (no json) and it must be placed in `src/schema` folder.

      The problem is that this command must be executed from the root dir (`backstage-plugin`).
      By default, it scans all the plugins and reads all the `src/schema/openapi.yaml` files, but it is possible to set a specific path:
      `yarn backstage-repo-tools schema openapi generate plugins/orchestrator-backend` to scan only our plugin.

      I didn't find a way to execute this command inside our plugin folder (`backstage-plugins/plugins/orchestrator-backend`). `cwd` is not effective because `@backstage/backend-openapi-utils` uses backstage-repo-tools that scan for the root folder here

      Goals:

      1. Enhance the repo-tools to accept custom directory
      2. Enhance the backend-openapi-utils according to changes in the previous point

              gciavarrini@redhat.com Gloria Ciavarrini
              gciavarrini@redhat.com Gloria Ciavarrini
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: