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

Requesting an individual resource - request produced using path parameter instead of ID in brackets encoded in URL #393

Open
BrandU opened this issue Nov 16, 2023 · 2 comments
Labels
question Further information is requested

Comments

@BrandU
Copy link

BrandU commented Nov 16, 2023

Hey David,

Quick question - is this somehow achievable using the generated client:

So desired HTTP request form:

{serviceUri}/odata/Constructions(1296481)....

OData generated client by your generator produces:

{serviceUri}/odata/Constructions/1296481/....

For the invocation looking like this:

ugkkClient.constructions(id).select("Id").expand(...)...

It seems that OData standard itself implicitly goes with the 1st form: link (see step 2)

Am I doing something wrong here?

Thank you!

@BrandU
Copy link
Author

BrandU commented Nov 16, 2023

Hey David,

Found a way how to configure the PathStyle.

HttpService httpService = new ApacheHttpClientHttpService(new Path(ugkkAPIUrl, PathStyle.IDENTIFIERS_IN_ROUND_BRACKETS), this::createClient, (url, m) -> m);

B.

@davidmoten davidmoten added the question Further information is requested label Nov 16, 2023
@davidmoten
Copy link
Owner

Yep, that looks like it. This is similar (and shows setting of PathStyle):

https://github.com/davidmoten/odata-client#how-to-create-a-client-for-your-odata-service-non-microsoft-api-with-bearer-tokens

@davidmoten davidmoten added enhancement New feature or request and removed enhancement New feature or request labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants