Skip to content

Add required parameter checks for client side serialization/deseriali… #283

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

earocorn
Copy link

@earocorn earocorn commented Mar 7, 2025

…zation

Checks if requests are client side for some parameters that are not required in response body / request body. This and a small change in the client module fix ConSysApiClient and ConSysApiClientModule

Copy link
Member

@alexrobin alexrobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if disabling IDs is the best solution for the client side.

For client side operations, perhaps we should just use the IdEncoderBase32 class which doesn't encrypt/decrypt the IDs but rather just converts them to/from base32 form. This would allow a client to parse IDs correctly and reuse them in subsequent requests.

One way to do it would be to fallback to IdEncoders32 in the base ResourceBinding

If argument idEncoders is null, just set it to a new IdEncoders32()

Then I think you can remove all the tests in the individual binding classes (need to keep checking for the case where the key is null though).

@@ -109,7 +109,7 @@ public IObsData deserialize(JsonReader reader) throws IOException
obs.withPhenomenonTime(OffsetDateTime.parse(reader.nextString()).toInstant());
else if ("resultTime".equals(propName))
obs.withResultTime(OffsetDateTime.parse(reader.nextString()).toInstant());
else if ("foi@id".equals(propName))
else if ("foi@id".equals(propName) && !ctx.isClientSide())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need at least this ID on the client side too.
The client needs to be able to parse it and also assign an FOI to an observation when posting it to the server.

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