Skip to content

Commit

Permalink
sonar correct/ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Nov 16, 2022
1 parent 8738541 commit e37660b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,7 @@ private Schema getSchemaDefinition(
return null;
}

@SuppressWarnings("java:S3655") // false positive
private void readAllInterfaces(OpenAPI openAPI, VisitorContext context, @Nullable Element definingElement, List<MediaType> mediaTypes,
Schema schema, ClassElement superType, Map<String, Schema> schemas, Map<String, ClassElement> superTypeArgs) {
String parentSchemaName = computeDefaultSchemaName(definingElement, superType, superTypeArgs, context);
Expand Down Expand Up @@ -1978,6 +1979,7 @@ private void readAllInterfaces(OpenAPI openAPI, VisitorContext context, @Nullabl
*
* @throws JsonProcessingException when Json parsing fails
*/
@SuppressWarnings("java:S3776")
protected Schema readSchema(AnnotationValue<io.swagger.v3.oas.annotations.media.Schema> schemaValue, OpenAPI openAPI, VisitorContext context, @Nullable Element type, Map<String, ClassElement> typeArgs, List<MediaType> mediaTypes) throws JsonProcessingException {
Map<CharSequence, Object> values = schemaValue.getValues()
.entrySet()
Expand Down Expand Up @@ -2205,6 +2207,7 @@ private void populateSchemaProperties(OpenAPI openAPI, VisitorContext context, E
}
}

@SuppressWarnings("java:S3776")
private void processPropertyElements(OpenAPI openAPI, VisitorContext context, Element type, Map<String, ClassElement> typeArgs, Schema schema, List<? extends TypedElement> publicFields, List<MediaType> mediaTypes, JavadocDescription classJavadoc) {

ClassElement classElement = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,12 @@ public static ClassElement getCustomSchema(String className, Map<String, ClassEl

// third read environments properties
Environment environment = getEnv(context);
for (Map.Entry<String, Object> entry : environment.getProperties(MICRONAUT_OPENAPI_SCHEMA, StringConvention.RAW).entrySet()) {
String configuredClassName = entry.getKey();
String targetClassName = (String) entry.getValue();
readCustomSchema(configuredClassName, targetClassName, customSchemas, context);
if (environment != null) {
for (Map.Entry<String, Object> entry : environment.getProperties(MICRONAUT_OPENAPI_SCHEMA, StringConvention.RAW).entrySet()) {
String configuredClassName = entry.getKey();
String targetClassName = (String) entry.getValue();
readCustomSchema(configuredClassName, targetClassName, customSchemas, context);
}
}

context.put(MICRONAUT_CUSTOM_SCHEMAS, customSchemas);
Expand Down

0 comments on commit e37660b

Please sign in to comment.