beam-community / jsonapi

JSON:API Serializer and Query Handler for Elixir
https://hex.pm/packages/jsonapi
MIT License
496 stars 78 forks source link

New Example on how to configure this lib. #138

Closed zacksiri closed 2 months ago

zacksiri commented 5 years ago

Any chance we can get a newer example application? A few things are not so clear, like how to use the ErrorView in phoenix etc...

jherdman commented 5 years ago

@zacksiri do you have some specific questions in mind? It may help a bit. I'm hoping to work on an example application in the next few weeks too.

doomspork commented 5 years ago

@jherdman I'm available to help if you'd like a hand. Having some idea of what folks like @zacksiri would find useful would be helpful; I built an example app for Ueberauth that I thought covered the bases but there's been recent requests for a lot of changes.

zacksiri commented 5 years ago

@jherdman @doomspork Hey, yeah I mean an example app, showing how to setup the hex with great defaults that will work for most case scenarios.

b4ugh commented 4 years ago

+1, would be very helpful to have an updated example app. Especially for how to handle getting errors (changeset_view.ex, error_view.ex, etc) to properly show in the jsonapi spec format

jeregrine commented 4 years ago

@b4ugh Would very happily and quickly accept contributions!

b4ugh commented 4 years ago

Well, I'm struggling to figure out how to get them (the error views) to work, or else I would! 😂 But if/once I'm able to figure it out I'd be happy to lend a hand!

jherdman commented 4 years ago

I've been thinking as of late that this lib should extract some of the Phoenix-y concerns, which should also include some modules for converting Ecto error changesets to responses. Hopefully I can find some time to finish drafting a mega RFC soon. I'll try to post a gist of the code I'm using for error changesets as soon as possible.

On Fri, Aug 7, 2020, 11:45 Dan Baugh notifications@github.com wrote:

Well, I'm struggling to figure out how to get them (the error views) to work, or else I would! 😂 But if/once I'm able to figure it out I'd be happy to lend a hand!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeregrine/jsonapi/issues/138#issuecomment-670581469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAZZCQBV7AJERGUA2P5E3R7QOSLANCNFSM4GA4VDHA .

jherdman commented 4 years ago

@b4ugh my changeset_view.ex looks like this https://gist.github.com/jherdman/d6c89166d4d427108629ec3d1618d199. I don't think we ought to pull this into the lib yet, I'm sure it can be tightened up (nor am I sure it belongs in this lib proper). Hopefully this gets you started.

jeregrine commented 4 years ago

@jherdman Looks pretty good to me!

github-actions[bot] commented 2 months ago

This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet. If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.

github-actions[bot] commented 2 months ago

Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!