Skip to content

Support links in resource objects (DocumentData) #144

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
OKTAYKIR opened this issue Jul 22, 2017 · 6 comments
Closed

Support links in resource objects (DocumentData) #144

OKTAYKIR opened this issue Jul 22, 2017 · 6 comments

Comments

@OKTAYKIR
Copy link

How can I create links object using noentityframework such as the following;

{
	"data": {
		"type": "user",
		"id": "1f42940ba0b046188b46ff43c6872eb4",
		 "links": {
			  "self": "https://www.example.com/api/v1/users/1f42940ba0b046188b46ff43c6872eb4"
			},
		"attributes": {
			"givenName": "Fyodor Mikhailovich",
			"familyName": "Dostoyevsky"
		}
	}
}
@jaredcnance
Copy link
Contributor

We do not currently support links objects within the resource object. However, I see no reason we shouldn't. I'm fine with adding this as a feature targetted for a 2.1.x release. Is this a blocker for your use case?

@OKTAYKIR
Copy link
Author

I need to use in the future but at the moment is not urgent.

Thanks

@jaredcnance jaredcnance changed the title Missing Links object when using noentityframework Support links in resource objects (DocumentData) Jul 23, 2017
@amit-ch
Copy link

amit-ch commented May 3, 2019

Is it possible to generate links object manually outside of resource objects with noentityframework. For example when I do get all, I should be able to generate first and last links

{
    "data": [
        {
            "attributes": {
                "isActive": false
            },
            "type": "organisation",
            "id": "1243"
        }
    ],
    "links": {
        "last": "https://localhost:44346/organisation?page[size]=10&page[number]=10",
        "first": "https://localhost:44346/organisation?page[size]=10&page[number]=1"
    }
}

@amit-ch
Copy link

amit-ch commented May 3, 2019

I am able to access PageManager just before serving the response and give values for total records and current page which is generating the links fine. If there is some other neat way of doing it, please let me know. Thanks.

@maurei
Copy link
Member

maurei commented May 3, 2019

@amit-ch that sounds like the way I'd try to solve it

@maurei
Copy link
Member

maurei commented Oct 10, 2019

Introduced in #558

@maurei maurei closed this as completed Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants