Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Unable to create resource at path '/user/{userId}/fans': A sibling ({bizId}) of this resource already has a variable path part -- only one is allowed #202

Open
helloworldtang opened this issue Jan 6, 2017 · 3 comments

Comments

@helloworldtang
Copy link

"paths": {
"/user/{bizId}/complaint": {
.....
,
"/user/{userId}/fans": {
"get": {

Import the format of the data above, will cause the wrong below:

Your API was not imported due to errors in the Swagger file.
Unable to create resource at path '/user/{userId}/fans': A sibling ({bizId}) of this resource already has a variable path part -- only one is allowed
Additionally, these warnings were found:
No responses specified for 'POST /user/{bizId}/complaint'

@lorenzoaws
Copy link

This is by design, precisely because of the message in the error. Can you do this instead?

"paths": {
"/user/{bizId}/complaint": {
.....
,
"/user/{bizId}/fans": {
"get": {

@helloworldtang
Copy link
Author

Thanks for your time and reply.
@lorenzoaws yes,i change the rest api.
However, this restriction conditions make people more confused

@danibrear
Copy link

This has caused us a big headache recently and only by finding this issue was I able to resolve it. We have a micro service architecture where a user has both an ID and a UUID.

/users/{userUUId}/ -> userUUId is global to the application
/users/{userId}/memberships/ -> userId is relative to the service

We were naming our variables with either userId for same service or userUUId for extended services and this "by design" feature caused our deploys to break for a week. The work around for us is to use the same variable name and then in the methods that are being called, make sure to add many comments aliasing this variable to what it actually is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants