Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
khieta committed May 9, 2024
1 parent 130e6af commit 0cb2445
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public String toString() {
*/
public static Schema parse(JsonOrHuman type, String str) throws InternalException, NullPointerException {
if (type == JsonOrHuman.Json) {
var schemaJson = parseJsonSchemaJni(str);
return new Schema(JsonOrHuman.Json, Optional.of(schemaJson), Optional.empty());
parseJsonSchemaJni(str);
return new Schema(JsonOrHuman.Json, Optional.of(str), Optional.empty());
} else {
var schemaText = parseHumanSchemaJni(str);
return new Schema(JsonOrHuman.Human, Optional.empty(), Optional.of(schemaText));
parseHumanSchemaJni(str);
return new Schema(JsonOrHuman.Human, Optional.empty(), Optional.of(str));
}

}
Expand Down
4 changes: 2 additions & 2 deletions CedarJavaFFI/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn parse_json_schema_internal<'a>(
let schema_string = String::from(schema_jstring);
match Schema::from_str(&schema_string) {
Err(e) => Err(Box::new(e)),
Ok(_) => Ok(JValueGen::Object(env.new_string(&schema_string)?.into())),
Ok(_) => Ok(JValueGen::Object(env.new_string("success")?.into())),
}
}
}
Expand All @@ -187,7 +187,7 @@ fn parse_human_schema_internal<'a>(
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(&schema_string)?.into())),
Ok(_) => Ok(JValueGen::Object(env.new_string("success")?.into())),
}
}
}
Expand Down

0 comments on commit 0cb2445

Please sign in to comment.