Swashbuckle.AspNetCore
Swashbuckle.AspNetCore copied to clipboard
Route parameters not used correctly?
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?
Is that ObjectId from MongoDb? I believe it has changed rather than swashbuckle?
Please provide a minimal reproducible example as a GitHub repository that demonstrates the issue you're experiencing so we can look into this further.
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.
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?
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.
This issue was closed because it has been inactive for 14 days since being marked as stale.