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

Route parameters not used correctly? #2575

Closed
RobThree opened this issue Dec 14, 2022 · 6 comments
Closed

Route parameters not used correctly? #2575

RobThree opened this issue Dec 14, 2022 · 6 comments
Labels
needs-repro A minimal reproducible example is needed stale Stale issues or pull requests

Comments

@RobThree
Copy link

RobThree commented Dec 14, 2022

This works:

[HttpGet("{id}")]
public Task<ConnectionProductDTO> GetAsync(long id, CancellationToken cancellationToken = default)
    => _connectionproductservice.GetAsync(id, cancellationToken);

Request URL: https://localhost:5001/api/v1/foo/907306994157748224

This doesn't:

[HttpGet("{id}")]
public Task<ConnectionProductDTO> GetAsync(ObjectId id, CancellationToken cancellationToken = default)
    => _connectionproductservice.GetAsync(id, cancellationToken);

Request URL: https://localhost:5001/api/v1/foo/{id}?id=907306994157748224

Note the {id}?id=... in the above url.

The only difference is long vs ObjectId in the controller method. I am still git-bisecting and figuring out what changed; but this did work a year ago. The ObjectId can be (implicitly) cast from/to a long.

Oh, I also tried adding [FromRoute] to the argument to no avail.

Has something changed?

@Havunen
Copy link

Havunen commented Apr 14, 2024

Is that ObjectId from MongoDb? I believe it has changed rather than swashbuckle?

@martincostello
Copy link
Collaborator

Please provide a minimal reproducible example as a GitHub repository that demonstrates the issue you're experiencing so we can look into this further.

@martincostello martincostello added the needs-repro A minimal reproducible example is needed label Apr 14, 2024
Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

@github-actions github-actions bot added the stale Stale issues or pull requests label Jun 14, 2024
@jgarciadelanoceda
Copy link
Contributor

Hi @RobThree.
This seems to be the same issue as #2921. Can you please close this as completed and see the swagger-ui issue linked?

@github-actions github-actions bot removed the stale Stale issues or pull requests label Jun 23, 2024
Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

@github-actions github-actions bot added the stale Stale issues or pull requests label Aug 22, 2024
Copy link
Contributor

github-actions bot commented Sep 5, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-repro A minimal reproducible example is needed stale Stale issues or pull requests
Projects
None yet
Development

No branches or pull requests

4 participants