-
-
Notifications
You must be signed in to change notification settings - Fork 158
DisableRoutingConvention #800
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
Comments
Thanks for reporting. However I cannot reproduce this on the current master branch. What I've tried is running the test {
"meta": {
"total-records": 7
},
"links": {
"self": "http://localhost/custom/route/todoItems?page[size]=5&page[number]=1",
"next": "http://localhost/custom/route/todoItems?page[size]=5&page[number]=2",
"first": "http://localhost/custom/route/todoItems?page[size]=5&page[number]=1",
"last": "http://localhost/custom/route/todoItems?page[size]=5&page[number]=2"
},
"data": [
{
"type": "todoItems",
"id": "49",
"attributes": {
"description": "Officia dicta accusantium eum eum perferendis corporis laudantium ut.",
"ordinal": 0,
"guidProperty": "d378c1b4-f65e-409f-9a71-ffe5dd75f915",
"alwaysChangingValue": "5e16696f-da09-43cb-8b80-d683eb04030d",
"createdDate": "2020-06-30T22:22:15.951418",
"achievedDate": null,
"updatedDate": null,
"calculatedValue": "calculated",
"offsetDate": null
},
"relationships": {
"owner": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/owner",
"related": "http://localhost/custom/route/todoItems/49/owner"
}
},
"assignee": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/assignee",
"related": "http://localhost/custom/route/todoItems/49/assignee"
}
},
"oneToOnePerson": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/oneToOnePerson",
"related": "http://localhost/custom/route/todoItems/49/oneToOnePerson"
}
},
"stakeHolders": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/stakeHolders",
"related": "http://localhost/custom/route/todoItems/49/stakeHolders"
}
},
"collection": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/collection",
"related": "http://localhost/custom/route/todoItems/49/collection"
}
},
"dependentOnTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/dependentOnTodo",
"related": "http://localhost/custom/route/todoItems/49/dependentOnTodo"
}
},
"parentTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/parentTodo",
"related": "http://localhost/custom/route/todoItems/49/parentTodo"
}
},
"childrenTodos": {
"links": {
"self": "http://localhost/custom/route/todoItems/49/relationships/childrenTodos",
"related": "http://localhost/custom/route/todoItems/49/childrenTodos"
}
}
},
"links": {
"self": "http://localhost/custom/route/todoItems/49"
}
},
{
"type": "todoItems",
"id": "50",
"attributes": {
"description": "Et dolorum odio similique illo omnis.",
"ordinal": 1,
"guidProperty": "4da62c9a-3118-4e51-8176-ad3a82f65e83",
"alwaysChangingValue": "7add3095-af87-4b82-965b-6196f6427d51",
"createdDate": "2020-04-23T12:18:09.186328",
"achievedDate": null,
"updatedDate": null,
"calculatedValue": "calculated",
"offsetDate": null
},
"relationships": {
"owner": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/owner",
"related": "http://localhost/custom/route/todoItems/50/owner"
}
},
"assignee": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/assignee",
"related": "http://localhost/custom/route/todoItems/50/assignee"
}
},
"oneToOnePerson": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/oneToOnePerson",
"related": "http://localhost/custom/route/todoItems/50/oneToOnePerson"
}
},
"stakeHolders": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/stakeHolders",
"related": "http://localhost/custom/route/todoItems/50/stakeHolders"
}
},
"collection": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/collection",
"related": "http://localhost/custom/route/todoItems/50/collection"
}
},
"dependentOnTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/dependentOnTodo",
"related": "http://localhost/custom/route/todoItems/50/dependentOnTodo"
}
},
"parentTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/parentTodo",
"related": "http://localhost/custom/route/todoItems/50/parentTodo"
}
},
"childrenTodos": {
"links": {
"self": "http://localhost/custom/route/todoItems/50/relationships/childrenTodos",
"related": "http://localhost/custom/route/todoItems/50/childrenTodos"
}
}
},
"links": {
"self": "http://localhost/custom/route/todoItems/50"
}
},
{
"type": "todoItems",
"id": "52",
"attributes": {
"description": "Atque nemo soluta sapiente qui impedit laborum libero sequi et.",
"ordinal": 1,
"guidProperty": "bace5a43-00f9-405b-88dd-3cdc38ea8668",
"alwaysChangingValue": "f6c1ff22-6176-457f-96da-cbbe5cde2406",
"createdDate": "2020-05-27T11:11:55.147949",
"achievedDate": null,
"updatedDate": null,
"calculatedValue": "calculated",
"offsetDate": null
},
"relationships": {
"owner": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/owner",
"related": "http://localhost/custom/route/todoItems/52/owner"
}
},
"assignee": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/assignee",
"related": "http://localhost/custom/route/todoItems/52/assignee"
}
},
"oneToOnePerson": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/oneToOnePerson",
"related": "http://localhost/custom/route/todoItems/52/oneToOnePerson"
}
},
"stakeHolders": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/stakeHolders",
"related": "http://localhost/custom/route/todoItems/52/stakeHolders"
}
},
"collection": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/collection",
"related": "http://localhost/custom/route/todoItems/52/collection"
}
},
"dependentOnTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/dependentOnTodo",
"related": "http://localhost/custom/route/todoItems/52/dependentOnTodo"
}
},
"parentTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/parentTodo",
"related": "http://localhost/custom/route/todoItems/52/parentTodo"
}
},
"childrenTodos": {
"links": {
"self": "http://localhost/custom/route/todoItems/52/relationships/childrenTodos",
"related": "http://localhost/custom/route/todoItems/52/childrenTodos"
}
}
},
"links": {
"self": "http://localhost/custom/route/todoItems/52"
}
},
{
"type": "todoItems",
"id": "53",
"attributes": {
"description": "Omnis voluptatum repellendus dolores nisi.",
"ordinal": 1,
"guidProperty": "4963d590-bdd1-4637-8fce-a3e653a0fc90",
"alwaysChangingValue": "ba81ac53-0365-43ce-8b3e-382af3da4c4d",
"createdDate": "2019-12-31T02:40:24.241526",
"achievedDate": null,
"updatedDate": null,
"calculatedValue": "calculated",
"offsetDate": null
},
"relationships": {
"owner": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/owner",
"related": "http://localhost/custom/route/todoItems/53/owner"
}
},
"assignee": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/assignee",
"related": "http://localhost/custom/route/todoItems/53/assignee"
}
},
"oneToOnePerson": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/oneToOnePerson",
"related": "http://localhost/custom/route/todoItems/53/oneToOnePerson"
}
},
"stakeHolders": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/stakeHolders",
"related": "http://localhost/custom/route/todoItems/53/stakeHolders"
}
},
"collection": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/collection",
"related": "http://localhost/custom/route/todoItems/53/collection"
}
},
"dependentOnTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/dependentOnTodo",
"related": "http://localhost/custom/route/todoItems/53/dependentOnTodo"
}
},
"parentTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/parentTodo",
"related": "http://localhost/custom/route/todoItems/53/parentTodo"
}
},
"childrenTodos": {
"links": {
"self": "http://localhost/custom/route/todoItems/53/relationships/childrenTodos",
"related": "http://localhost/custom/route/todoItems/53/childrenTodos"
}
}
},
"links": {
"self": "http://localhost/custom/route/todoItems/53"
}
},
{
"type": "todoItems",
"id": "54",
"attributes": {
"description": "Error alias aut dolore non.",
"ordinal": 0,
"guidProperty": "01efa2a3-7128-4c3f-a6d1-649ae2e574f1",
"alwaysChangingValue": "49f98f1b-81a9-40c8-8712-069e7f44e5f7",
"createdDate": "2019-08-14T19:03:11.896882",
"achievedDate": null,
"updatedDate": null,
"calculatedValue": "calculated",
"offsetDate": null
},
"relationships": {
"owner": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/owner",
"related": "http://localhost/custom/route/todoItems/54/owner"
}
},
"assignee": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/assignee",
"related": "http://localhost/custom/route/todoItems/54/assignee"
}
},
"oneToOnePerson": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/oneToOnePerson",
"related": "http://localhost/custom/route/todoItems/54/oneToOnePerson"
}
},
"stakeHolders": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/stakeHolders",
"related": "http://localhost/custom/route/todoItems/54/stakeHolders"
}
},
"collection": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/collection",
"related": "http://localhost/custom/route/todoItems/54/collection"
}
},
"dependentOnTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/dependentOnTodo",
"related": "http://localhost/custom/route/todoItems/54/dependentOnTodo"
}
},
"parentTodo": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/parentTodo",
"related": "http://localhost/custom/route/todoItems/54/parentTodo"
}
},
"childrenTodos": {
"links": {
"self": "http://localhost/custom/route/todoItems/54/relationships/childrenTodos",
"related": "http://localhost/custom/route/todoItems/54/childrenTodos"
}
}
},
"links": {
"self": "http://localhost/custom/route/todoItems/54"
}
}
]
} Note that the custom route is used in all returned links in the response above. Can you verify your project against the latest master branch? If you still see this problem, please provide some repro steps for us to investigate. |
Controller: public class CompanyController : JsonApiController Example 1 Example 2 |
This is not supported, as described at https://json-api-dotnet.github.io/JsonApiDotNetCore/usage/routing.html, specifically:
#786 already tracks the request for having a different resource name in routes. So I think this is a duplicate of that. |
@ahmad550, this is not correct. See #805 (comment) Docs have been updated in that PR. Please check it out |
Description
public class CompaniesController : JsonApiController
when I use DisableRoutingConvention and give it the route with same name like controller name in plural it works fine but the problem is that if i want to change the route like [Route("api/v1/todo")] the response links will not be the same as my route it will still take the result of the links as it is without disableRoutingCounvention
Environment
The text was updated successfully, but these errors were encountered: