Uh oh!
There was an error while loading. Please reload this page.
Add support for new schema syntax - #142
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| let schema_string = String::from(schema_jstring); | ||
| match Schema::from_str_natural(&schema_string) { | ||
| Err(e) => Err(Box::new(e)), | ||
| Ok(_) => Ok(JValueGen::Object(env.new_string("Success")?.into())), |
There was a problem hiding this comment.
Returns the string Success on success, but on the Java side, Schema.parse() seems to expect it to return the schema text?
There was a problem hiding this comment.
Ah, that is indeed not doing the right thing (and testing didn't catch it since we don't have any tests that do something with a parsed schema). Will fix in next commit.
There was a problem hiding this comment.
Curious why return the schema contents? Java already had a string containing the schema contents, I think?
There was a problem hiding this comment.
Yes, Java already has the string -- the only new information "returned" by the parsing function is whether an exception was thrown or not. Looking at it again, it likely saves some time not to pass back the string, so I'll revert to that.
khieta
commented
May 9, 2024
It turned out to not be too difficult to add support for the new integration tests, so I added that change to this PR. |
| "tests/example_use_cases/2c.json", | ||
| "tests/example_use_cases/3a.json", | ||
| "tests/example_use_cases/3b.json", | ||
| "tests/example_use_cases/3c.json", |
There was a problem hiding this comment.
[nit] Can we keep the comment explaining why 4c isn't run?
There was a problem hiding this comment.
I deleted it because that test was not moved over to https://github.com/cedar-policy/cedar-integration-tests -- do you think we should maintain this test in our integration test repo even if it's not used?
Issue #, if available:
Resolves#130
Description of changes:
interface.rsto a separatetests.rsfile