Skip to content

Support REST convention with pluralized entities in mode with IgnoreOperationId=true#121

Closed
GennadyGS wants to merge 1 commit intofsprojects:masterfrom
GennadyGS:master
Closed

Support REST convention with pluralized entities in mode with IgnoreOperationId=true#121
GennadyGS wants to merge 1 commit intofsprojects:masterfrom
GennadyGS:master

Conversation

@GennadyGS
Copy link

@GennadyGS GennadyGS commented Apr 6, 2019

Problem is in confusing method names, generated for routes with parameters (due to name collisions).

For example, following provider methods are generated for given routes:
/areas -> GetAreas(...)
/areas/{id} -> GetAreas1(...)

Desired behavior:
/areas -> GetAreas(...)
/areas/{id} -> GetArea(...)

The solution is to singularize route segments, followed by parameters.

Existing unit tests are fixed, integration tests are remained broken (issues not related to PR in both cases). New tests are not created, because of existing issues and because I did not find simple way to test my changes. I am ready to elaborate on tests in case of principal approval of idea.

As for new branch openapi and nuget beta I was not able to test it, because it does not work for me (at least in LinqPad). However I noticed, that logic, related to my changes, basically remained the same.

Thanks.

@sergey-tihon
Copy link
Member

Thank you the idea and implementation, @GennadyGS!
Agree, that it naming approach is better than initial one.
Since code changes a lot in master, I ported you code and merged in both TPs.
Changes released in 0.10.0-beta10

@sergey-tihon sergey-tihon added this to the v0.10.0 milestone Nov 10, 2019
@GennadyGS
Copy link
Author

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants