Skip to content

Namespace not honored when RelativeLinks=true #763

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

Closed
fdlane opened this issue May 15, 2020 · 5 comments · Fixed by #766
Closed

Namespace not honored when RelativeLinks=true #763

fdlane opened this issue May 15, 2020 · 5 comments · Fixed by #766

Comments

@fdlane
Copy link
Contributor

fdlane commented May 15, 2020

Description

In the GettingStarted App if you set RelativeLinks = true; the links in response do not include the namespace. Should it not return "self": "api/people"?

services.AddJsonApi<SampleDbContext>(options =>
    {
        options.Namespace = "api";
        options.RelativeLinks = true;
     });
{
    "links": {
        "self": "/people"
    },
    "data": [
        {
            "type": "people",
            "id": "1",
            "attributes": {
                "name": "John Doe"
            },
            "relationships": {
                "articles": {
                    "links": {
                        "self": "/people/1/relationships/articles",
                        "related": "/people/1/articles"
...

...

Environment

  • JsonApiDotNetCore Version: master
  • Other Relevant Package Versions: core 3.1
@fdlane
Copy link
Contributor Author

fdlane commented May 15, 2020

Is this correct?

@bart-degreed
Copy link
Contributor

bart-degreed commented May 16, 2020 via email

@bart-degreed
Copy link
Contributor

LinkBuilder is the place to fix this, but there's also some path parsing in JsonApiMiddleware you may want to verify.

@bart-degreed
Copy link
Contributor

@fdlane Do you wanna take this one?

@fdlane
Copy link
Contributor Author

fdlane commented May 20, 2020

@bart-degreed will do

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

Successfully merging a pull request may close this issue.

2 participants