Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifying base URL #731

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

bitgopatmcl
Copy link
Contributor

Adds support for emitting the servers section of an OpenAPI spec by annotating h.apiSpec objects with the appropriate JSDoc tags. For example:

    /** An API spec
     *
     * @url /api/v1
     **/
    export const test = h.apiSpec({
      'api.test': {
        get: h.httpRoute({
          path: '/test',
          method: 'GET',
          request: h.httpRequest({}),
          response: {
            200: t.string,
          },
        })
      }
    });

Will result in something like this in the emitted OpenAPI:

servers:
- description: An API spec
  url: /api/v1

@bitgopatmcl bitgopatmcl requested a review from a team as a code owner April 2, 2024 14:07
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're trying to support a use case of specifying multiple servers. Should we add a test for that use-case?

@bitgopatmcl bitgopatmcl merged commit 8d18a84 into BitGo:master Apr 2, 2024
6 checks passed
@bitgopatmcl bitgopatmcl deleted the base-url-support branch April 2, 2024 15:08
Copy link

github-actions bot commented Apr 2, 2024

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants