Open luke-zhang opened 7 years ago
This is not possible at the moment, but I'm open to a PR to allow this.
The request URI comes from here:
It's then passed into the serializer here:
It's prepended to every generated path here:
I think a property GenerateRelativeUrls
in JsonApiSerializer
(default value: false
) is a nice backwards-compatible spot to put this.
@joukevandermaas thanks a lot for your help. I am thinking if IUrlPathBuilder
is better than JsonApiSerializer
to place this property since it can be customized easily.
I agree with you, but it currently does not have this behavior. So that would be breaking backwards compatibility. If you can think of a way to not break existing stuff, I'm all for it.
is there a way to return relative url for links object. in our projects, we'd like to see this
"links": { "self": "/api/sessions" },
instead of"links": { "self": "http://localhost:49895/api/sessions" },