Skip to content

Commit

Permalink
Fix issue 399
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Jul 7, 2023
1 parent 7e3f5b8 commit 9113793
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public boolean parse(byte[] apiSpecificationContent) throws AppException {
createBatchResource(openAPI);
return true;
} catch (Exception e) {
if(logger.isDebugEnabled()) {
if (logger.isDebugEnabled()) {
logger.error("Error parsing OData V4 MetaData.", e);
}
return false;
Expand Down Expand Up @@ -503,11 +503,16 @@ private Schema<Object> getSchemaForType(Edm edm, EdmType type, boolean asRef, bo
schema = new ObjectSchema();
for (String propertyName : entityType.getPropertyNames()) {
EdmProperty property = (EdmProperty) entityType.getProperty(propertyName);
logger.debug("Property : {}", property);
Schema<Object> propSchema = getSchemaForType(edm, property.getType(), true, property.isCollection());
propSchema.setMaxLength(property.getMaxLength());
propSchema.setDefault(property.getDefaultValue());
propSchema.setNullable(property.isNullable());
schema.addProperty(propertyName, propSchema);
logger.debug("propSchema : {}", propSchema);

if(propSchema != null) {
propSchema.setMaxLength(property.getMaxLength());
propSchema.setDefault(property.getDefaultValue());
propSchema.setNullable(property.isNullable());
schema.addProperty(propertyName, propSchema);
}
}
EdmStructuredType typeImpl = (EdmStructuredType) type;
schema.setDescription(getDescription(typeImpl));
Expand Down

0 comments on commit 9113793

Please sign in to comment.