} else if (patch == null) { return master; } else if (!hasSchemaAnnotation(patch)) { return master;
return arraySchema; if (!hasSchemaAnnotation(schema)) { return arraySchema;
public static boolean hasArrayAnnotation(io.swagger.v3.oas.annotations.media.ArraySchema array) { if (array == null) { return false; } if (array.uniqueItems() == false && array.maxItems() == Integer.MIN_VALUE && array.minItems() == Integer.MAX_VALUE && !hasSchemaAnnotation(array.schema()) && !hasSchemaAnnotation(array.arraySchema()) ) { return false; } return true; }
@Override public List<NamedType> findSubtypes(Annotated a) { Schema schema = a.getAnnotation(Schema.class); if (schema == null) { final ArraySchema arraySchema = a.getAnnotation(ArraySchema.class); if (arraySchema != null) { schema = arraySchema.schema(); } } if (AnnotationsUtils.hasSchemaAnnotation(schema)) { final Class<?>[] classes = schema.subTypes(); final List<NamedType> names = new ArrayList<>(classes.length); for (Class<?> subType : classes) { names.add(new NamedType(subType)); } if (!names.isEmpty()) { return names; } } return Collections.emptyList(); }
@Override public io.swagger.v3.oas.annotations.media.Schema arraySchema() { io.swagger.v3.oas.annotations.media.Schema patchSchema = patch.arraySchema(); if (!hasSchemaAnnotation(patchSchema)) { patchSchema = null; } if (patchSchema == null) { return master.arraySchema(); } else { return mergeSchemaAnnotations(master.arraySchema(), patch.arraySchema()); } }
@Override public io.swagger.v3.oas.annotations.media.Schema schema() { io.swagger.v3.oas.annotations.media.Schema patchSchema = patch.schema(); if (!hasSchemaAnnotation(patchSchema)) { patchSchema = null; } if (patchSchema == null) { return master.schema(); } else { return mergeSchemaAnnotations(master.schema(), patch.schema()); } }
if (!hasSchemaAnnotation(tS)) { tS = null; if (!hasSchemaAnnotation(tAs)) { tAs = null; if (!hasSchemaAnnotation(cS)) { cS = null; if (!hasSchemaAnnotation(cAs)) { cAs = null;
io.swagger.v3.oas.annotations.Parameter paramAnnotation = (io.swagger.v3.oas.annotations.Parameter) annotation; if (paramAnnotation.content().length > 0) { if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.content()[0].schema())) { contentSchema = paramAnnotation.content()[0].schema(); if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.schema())) { paramSchema = paramAnnotation.schema();
if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.content()[0].schema())) { contentSchema = paramAnnotation.content()[0].schema(); if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.schema())) { paramSchema = paramAnnotation.schema();
private void resolveArraySchema(AnnotatedType annotatedType, ArraySchema schema, io.swagger.v3.oas.annotations.media.ArraySchema resolvedArrayAnnotation) { Integer minItems = resolveMinItems(annotatedType, resolvedArrayAnnotation); if (minItems != null) { schema.minItems(minItems); } Integer maxItems = resolveMaxItems(annotatedType, resolvedArrayAnnotation); if (maxItems != null) { schema.maxItems(maxItems); } Boolean uniqueItems = resolveUniqueItems(annotatedType, resolvedArrayAnnotation); if (uniqueItems != null) { schema.uniqueItems(uniqueItems); } Map<String, Object> extensions = resolveExtensions(annotatedType, resolvedArrayAnnotation); if (extensions != null) { schema.extensions(extensions); } if (resolvedArrayAnnotation != null) { if (AnnotationsUtils.hasSchemaAnnotation(resolvedArrayAnnotation.arraySchema())) { resolveSchemaMembers(schema, null, null, resolvedArrayAnnotation.arraySchema()); } } } }
public static Optional<Schema> getSchemaFromAnnotation(io.swagger.v3.oas.annotations.media.Schema schema, Components components, JsonView jsonViewAnnotation) { if (schema == null || !hasSchemaAnnotation(schema)) { return Optional.empty();
if (AnnotationsUtils.hasSchemaAnnotation(ctxSchema)) { if (!StringUtils.isBlank(ctxSchema.name())) { propSchemaName = ctxSchema.name(); io.swagger.v3.oas.annotations.media.ArraySchema ctxArraySchema = AnnotationsUtils.getArraySchemaAnnotation(annotations); if (AnnotationsUtils.hasArrayAnnotation(ctxArraySchema)) { if (AnnotationsUtils.hasSchemaAnnotation(ctxArraySchema.schema())) { if (!StringUtils.isBlank(ctxArraySchema.schema().name())) { propSchemaName = ctxArraySchema.schema().name();
return arraySchema; if (!hasSchemaAnnotation(schema)) { return arraySchema;
public static boolean hasArrayAnnotation(io.swagger.v3.oas.annotations.media.ArraySchema array) { if (array == null) { return false; } if (array.uniqueItems() == false && array.maxItems() == Integer.MIN_VALUE && array.minItems() == Integer.MAX_VALUE && !hasSchemaAnnotation(array.schema()) && !hasSchemaAnnotation(array.arraySchema()) ) { return false; } return true; }
@Override public List<NamedType> findSubtypes(Annotated a) { Schema schema = a.getAnnotation(Schema.class); if (schema == null) { final ArraySchema arraySchema = a.getAnnotation(ArraySchema.class); if (arraySchema != null) { schema = arraySchema.schema(); } } if (AnnotationsUtils.hasSchemaAnnotation(schema)) { final Class<?>[] classes = schema.subTypes(); final List<NamedType> names = new ArrayList<>(classes.length); for (Class<?> subType : classes) { names.add(new NamedType(subType)); } if (!names.isEmpty()) { return names; } } return Collections.emptyList(); }
@Override public io.swagger.v3.oas.annotations.media.Schema schema() { io.swagger.v3.oas.annotations.media.Schema patchSchema = patch.schema(); if (!hasSchemaAnnotation(patchSchema)) { patchSchema = null; } if (patchSchema == null) { return master.schema(); } else { return mergeSchemaAnnotations(master.schema(), patch.schema()); } }
@Override public io.swagger.v3.oas.annotations.media.Schema arraySchema() { io.swagger.v3.oas.annotations.media.Schema patchSchema = patch.arraySchema(); if (!hasSchemaAnnotation(patchSchema)) { patchSchema = null; } if (patchSchema == null) { return master.arraySchema(); } else { return mergeSchemaAnnotations(master.arraySchema(), patch.arraySchema()); } }
io.swagger.v3.oas.annotations.Parameter paramAnnotation = (io.swagger.v3.oas.annotations.Parameter) annotation; if (paramAnnotation.content().length > 0) { if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.content()[0].schema())) { contentSchema = paramAnnotation.content()[0].schema(); if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.schema())) { paramSchema = paramAnnotation.schema();
if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.content()[0].schema())) { contentSchema = paramAnnotation.content()[0].schema(); if (AnnotationsUtils.hasSchemaAnnotation(paramAnnotation.schema())) { paramSchema = paramAnnotation.schema();
private void resolveArraySchema(AnnotatedType annotatedType, ArraySchema schema, io.swagger.v3.oas.annotations.media.ArraySchema resolvedArrayAnnotation) { Integer minItems = resolveMinItems(annotatedType, resolvedArrayAnnotation); if (minItems != null) { schema.minItems(minItems); } Integer maxItems = resolveMaxItems(annotatedType, resolvedArrayAnnotation); if (maxItems != null) { schema.maxItems(maxItems); } Boolean uniqueItems = resolveUniqueItems(annotatedType, resolvedArrayAnnotation); if (uniqueItems != null) { schema.uniqueItems(uniqueItems); } Map<String, Object> extensions = resolveExtensions(annotatedType, resolvedArrayAnnotation); if (extensions != null) { schema.extensions(extensions); } if (resolvedArrayAnnotation != null) { if (AnnotationsUtils.hasSchemaAnnotation(resolvedArrayAnnotation.arraySchema())) { resolveSchemaMembers(schema, null, null, resolvedArrayAnnotation.arraySchema()); } } } }