Skip to content
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

OpenLibrary API proxy example #79

Closed
wants to merge 3 commits into from
Closed

OpenLibrary API proxy example #79

wants to merge 3 commits into from

Conversation

emcfarlane
Copy link
Collaborator

@emcfarlane emcfarlane commented Sep 29, 2023

OpenLibrary use a live books API to demo mapping RPC->REST.

The search service returns duplicate fields: num_found, at the top and bottom of a list. This fails with protojson: golang/protobuf#1568
It would be useful for implementations to handle route by route mutations. Currently using the proxy to mutate request/respons. I think to support all the weirdness of REST apis we will have to give users lots of flexibility on translating.

Stripe

I didn't realize stripe doesn't accept JSON on POST... only url encoded values using their custom syntax: https://stripe.com/docs/api/payment_intents/create . See the first commit.

So this example is a dead end. It surprisingly works for creating and getting a payment intent if you don't use any fields with an _, but anything more complex won't be possible.

@emcfarlane emcfarlane self-assigned this Sep 29, 2023
@emcfarlane emcfarlane changed the title Stripe POST have to be URL encoded OpenLibrary API example Oct 3, 2023
@emcfarlane emcfarlane changed the title OpenLibrary API example OpenLibrary API proxy example Oct 3, 2023
@emcfarlane emcfarlane changed the base branch from ed/mv-examples to main October 23, 2023 17:00
@jhump
Copy link
Member

jhump commented Oct 23, 2023

We can revisit this later -- likely something in connectrpc/examples-go repo.

@jhump jhump closed this Oct 23, 2023
@emcfarlane emcfarlane deleted the ed/example-stripe branch October 26, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants