-
Notifications
You must be signed in to change notification settings - Fork 1
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
[CIN-2018]: specify data types with non annotated properties #863
base: master
Are you sure you want to change the base?
Conversation
"ALLOW_ACCESS": {"value": ["GROUP_EVERYONE"]}, | ||
"DENY_ACCESS": {"value": []} | ||
"ALLOW_ACCESS": {"type": "string", "value": ["GROUP_EVERYONE"]}, | ||
"DENY_ACCESS": {"type": "string", "value": []} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to remove these empty arrays (as discussed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to an empty string in the array and now it is the same as the OpenApi schema after update of data types and the tests pass
|
||
private void writeType(JsonGenerator jgen, String name, Object value) throws IOException | ||
{ | ||
if ("cm:content".equals(name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should work via the value instead. cm:content
will always be a file reference if it's present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to value-based check
5953146
to
0da78a5
Compare
0bad124
to
38ee291
Compare
Looks 🆗 |
{ | ||
type = "float"; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should also cope with collections. You could refactor this to extract a function:
private String selectTypeByValue(Object value)
{
if (value instanceof Boolean)
...
else if (value instanceof Collection collection)
{
if (collection.isEmpty())
{
// This should not happen because empty collections should already be filtered out.
throw new ...;
}
return selectTypeByValue(collection.stream().findAny());
}
// Default to string.
return "string";
}
After updating schema from Ingestion API side, all tests including OpenApi schema test are now passing