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

Extract shared logic for serializing credential options into a new JSONSerializer module #438

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

santiagorodriguez96
Copy link
Contributor

Follow up for #436.

There are a couple of additional methods used for serializing the objects that were shared between WebAuthn::PublicKeyCredential::Options and WebAuthn::PublicKeyCredential::Entity.

This PR attempts to extract them into the same module as we started to do in #436 after removing awrence.

Now our classes can include the JSONSerializer module and define an attributes method and they will be able to call as_json which will return a hash with the defined attributes as keys and their respective values – which if they were hashes, their keys will be deeply converted to camelcase.

Copy link
Member

@brauliomartinezlm brauliomartinezlm left a comment

Choose a reason for hiding this comment

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

I liked this! Thank you

@brauliomartinezlm brauliomartinezlm merged commit ae3f1fe into master Nov 12, 2024
10 checks passed
@brauliomartinezlm brauliomartinezlm deleted the sr--add-json-serializer branch November 12, 2024 22:08
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