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

feat(cli): Add support for in-lined path parameters #5231

Merged
merged 14 commits into from
Nov 21, 2024

Conversation

amckinney
Copy link
Member

@amckinney amckinney commented Nov 20, 2024

This adds support for including path-parameters in the request section of the endpoint definition. This includes:

  1. A new fern check rule which ensures that only one path-parameters block is present for any endpoint.
  2. The inline-path-parameters OpenAPI importer setting.

With this, both path-parameters formats are supported so that users can configure an endpoint like so:

service:
  auth: false
  base-path: /base/{baseParameter}
  path-parameters:
    fakeBaseParameter: string
  endpoints:
    legacy:
      path: /path/{parameter}/to/endpoint
      path-parameters:
        parameter: string
      method: POST

    inlined:
      path: /path/{parameter}/to/endpoint
      request:
        name: InlinedRequest
        path-parameters:
          parameter: string
      method: POST

Note that a new path-parameters test definition was added, and some generators might produce an in-lined request type alongside positional path parameters. This case should be handled within each generator with a generator-specific inlinePathParameters configuration option.

Copy link

github-actions bot commented Nov 20, 2024

@amckinney amckinney changed the title feat(cli): [WIP] Add support for in-lined path parameters feat(cli): Add support for in-lined path parameters Nov 20, 2024
@amckinney amckinney marked this pull request as ready for review November 20, 2024 22:31
@amckinney amckinney requested a review from dsinghvi as a code owner November 20, 2024 22:31
@amckinney amckinney enabled auto-merge (squash) November 21, 2024 04:03
@amckinney amckinney merged commit e49cbf3 into main Nov 21, 2024
58 of 60 checks passed
@amckinney amckinney deleted the amckinney/fern/path-parameters branch November 21, 2024 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants