Skip to content

add items to schema in oas 3.0 #4108

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class Schema<T> {
private java.util.Map<String, Object> extensions = null;
protected List<T> _enum = null;
private Discriminator discriminator = null;
private Schema<?> items = null;

private boolean exampleSetFlag;

Expand All @@ -81,6 +82,25 @@ protected Schema(String type, String format) {
this.format = format;
}

/**
* returns the items property from a Schema instance.
*
* @return Schema items
**/

public Schema<?> getItems() {
return items;
}

public void setItems(Schema<?> items) {
this.items = items;
}

public Schema items(Schema<?> items) {
this.items = items;
return this;
}

/**
* returns the name property from a from a Schema instance. Ignored in serialization.
*
Expand Down Expand Up @@ -812,14 +832,15 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.extensions, schema.extensions) &&
Objects.equals(this.discriminator, schema.discriminator) &&
Objects.equals(this._enum, schema._enum) &&
Objects.equals(this._default, schema._default);
Objects.equals(this._default, schema._default)&&
Objects.equals(this.items, schema.items);
}

@Override
public int hashCode() {
return Objects.hash(title, multipleOf, maximum, exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, maxItems,
minItems, uniqueItems, maxProperties, minProperties, required, type, not, properties, additionalProperties, description, format, $ref,
nullable, readOnly, writeOnly, example, externalDocs, deprecated, xml, extensions, discriminator, _enum, _default);
nullable, readOnly, writeOnly, example, externalDocs, deprecated, xml, extensions, discriminator, _enum, _default, items);
}

public java.util.Map<String, Object> getExtensions() {
Expand Down Expand Up @@ -879,6 +900,7 @@ public String toString() {
sb.append(" deprecated: ").append(toIndentedString(deprecated)).append("\n");
sb.append(" discriminator: ").append(toIndentedString(discriminator)).append("\n");
sb.append(" xml: ").append(toIndentedString(xml)).append("\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down