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

Representable 4: problem when parsing looks at one field but wants to create two #268

Open
apotonick opened this issue Jul 15, 2023 · 0 comments

Comments

@apotonick
Copy link
Member

      class Representer < Representable::Decorator
        include Representable::Hash

# Problem: we want to serialize jwt_token_exp, and NOT expires_at
#           we want to deserialize jwt_token_exp AND expires_at with its own parsing logic applied.
        # property :expires_at
        property :expires_at,
          parse_filter: ->(fragment, options) { Trace.parse_exp(fragment) },
          as: :jwt_token_exp, readable: false
        property :jwt_token_exp # FIXME: this is not clean. expires_at will be overridden with jwt_token_exp when serializing.
        property :id_token
        property :refresh_token
        property :api_key
        property :trailblazer_pro_host
        property :firebase_upload_url
        property :firestore_fields_template
        property :firebase_refresh_url
        property :firebase_signin_url
      end
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

No branches or pull requests

1 participant