Closed zsiryani closed 1 year ago
Hi @zaidsir, Thanks for reporting these issues. I'll take a look when I have the time unless you have a PR prepared. ;-)
The same works in 2.2.0 verions It handles NPE. Like making use of Optional.ofNullable. class name: Schema
public Set<String> getRequiredAttributeNames() {
Collection<SchemaAttribute> schemaAttrs = schemaAttributes;
if (CollectionUtils.isEmpty(schemaAttrs)) {
schemaAttrs = Optional.ofNullable(schema).map(Schema::getSchemaAttributes).orElse(Collections.emptySet());
}
return internalGetAttributeData(schemaAttrs, "", SchemaAttribute::isRequired)
.stream()
.filter(p -> BooleanUtils.isTrue(p.getRight()))
.map(Pair::getLeft)
.collect(toSet());
}
versus new method in 2.3.0 causes issues i.e. NPE.
Example we can have a variable annotated with
public static final String SCHEMA = "urn:abc:def:abc:abc:1.0";
Hello @galovics, a simple pull request created. Please review it
Just for reference, the PR is here: https://github.com/redskap/swagger-brake/pull/66
@zaidsir the other issue, with the complex dotted attribute name is fixed with this PR: https://github.com/redskap/swagger-brake/pull/84
Hello, I have a case where
attributeRequiredMap.get(attrToSearchFor);
is returning null in the BooleanisRequired
like the following ImageI was wondering if the
isRequired
can be converted into a primitive boolean in order not to have NPE, the following is the content of the mapAlso current
attrToSearchFor
value isurn:scim:schemas:extension:workspace:1
the closest value in the map isurn:scim:schemas:extension:workspace:1.0
I suspect that is this something related to the construction ofattrToSearchFor
using the stringJoiner.Thank you