Skip to content

endPointsMapping #7106

@KunalBurangi

Description

@KunalBurangi
  const config = {
    rest: {
      port: +(process.env.PORT ?? 3000),
      host: process.env.HOST,
      // The `gracePeriodForClose` provides a graceful close for http/https
      // servers with keep-alive clients. The default value is `Infinity`
      // (don't force-close). If you want to immediately destroy all sockets
      // upon stop, set its value to `0`.
      // See https://www.npmjs.com/package/stoppable
      gracePeriodForClose: 5000, // 5 seconds
      openApiSpec: {
        // useful when used with OpenAPI-to-GraphQL to locate your application
        setServersFromRequest: true,
        endpointMapping: {
          "/openapi.json": { version: "3.0.0", format: "json" },
          "/openapi.yaml": { version: "2.0.0", format: "yaml" },
        },
      },
    },
  }

after adding endpointMapping with yaml option it still doesn't give any way to generate the openapi.yaml spec it only works for json.

is there any other place where we need to do any changes ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    OpenAPIRESTIssues related to @loopback/rest package and REST transport in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions