Skip to content

Comments

Adds functionality to parse Entity from JSON#292

Merged
muditchaudhary merged 17 commits intocedar-policy:mainfrom
muditchaudhary:addsEntities
Feb 12, 2025
Merged

Adds functionality to parse Entity from JSON#292
muditchaudhary merged 17 commits intocedar-policy:mainfrom
muditchaudhary:addsEntities

Conversation

@muditchaudhary
Copy link
Contributor

Description

  1. Implements and registers EntityDeserializer for converting JSON strings into Entity objects.
  2. Modifies CedarJson visibility to allow its use in a different package or module.
  3. Adds two new parsing methods to the Entity class:
    • Entity.parse(String jsonString): Loads an Entity from a JSON string.
    • Entity.parse(Path filePath): Loads an Entity from a JSON file.
  4. Includes unit tests for the new Entity.parse() methods.

Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
@muditchaudhary muditchaudhary marked this pull request as ready for review February 11, 2025 17:09
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Copy link
Contributor

@cdisselkoen cdisselkoen left a comment

Choose a reason for hiding this comment

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

Looks good. I didn't look at the tests in detail but I trust they are correct. I think we already test this functionality through the corpus tests anyway?

@muditchaudhary muditchaudhary merged commit be7971c into cedar-policy:main Feb 12, 2025
4 checks passed
jtbrain pushed a commit to jtbrain/cedar-java that referenced this pull request Feb 18, 2025
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
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.

3 participants