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

Global Path Parameter - Request Example Does Not Reflect Overrides #5841

Open
Koubek opened this issue Feb 3, 2025 · 0 comments
Open

Global Path Parameter - Request Example Does Not Reflect Overrides #5841

Koubek opened this issue Feb 3, 2025 · 0 comments
Labels
bug Issues reporting bugs.

Comments

@Koubek
Copy link

Koubek commented Feb 3, 2025

Which Fern component?

Fern Docs

How urgent is this?

P2 - Medium (Would be helpful)

What's the issue?

Steps to reproduce:

  1. Create api.yml with global path-parameters:
base-path: /{tenant}/{environment}/{company}
path-parameters:
  tenant: string
  environment: string
  company: string
  1. All endpoints properly inherit these parameters, that's great and all works fine.
  2. The problem came when we needed to add an exclusion and you introduced the possibility to override those global path parameters. We have one endpoint where we need just two of them.
  3. Create an endpoint definition overriding the default behavior:
service:
  base-path: ""
  endpoints: 
    getCompanies:
      display-name: Get all companies
      # THIS IS WHERE WE OVERRIDE THE DEFAULT BEHAVIOR:
      base-path: /{tenant}/{environment}
      path: "/companies"
      path-parameters:
        tenant: string
        environment: string
      method: GET
      response: Companies
      examples:
        - path-parameters:
            tenant: bdf5f739-9e02-4e49-8006-35321e318250
            environment: production
          response:
            body:
              value:
                - id: "17ff1351-d07d-4b85-8957-b4b585f47aad"
                  systemVersion: "24.0.16410.18056"
                  name: "CRONUS International Ltd."
                  displayName: ""
                - id: "872336d7-5183-4c0b-9b47-755f3d6d77e7"
                  systemVersion: "24.0.16410.18056"
                  name: "TestCompany"
                  displayName: "TestCompany"
  1. The previous works fine for the endpoint URL itself but the example snippet still includes the company segment in the URL as a parameter {company}:

Image

Workaround

No response

Logs & Additional Context

We currently use 0.44.6 as #5810 blocks us using the latest versions. However, when tested using WSL I did see the same behavior. So it looks like this bug is still there.

@Koubek Koubek added the bug Issues reporting bugs. label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues reporting bugs.
Development

No branches or pull requests

1 participant