Skip to content
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

Tweak codegen logic for formatting, documentation and handling of anyOf #1152

Merged
merged 9 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
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 @@ -81,7 +81,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("acknowledged");
generator.write(this.acknowledged);

}

// ---------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public final String type() {
}

/**
* Additional details about the error
* Additional details about the error.
*/
public final Map<String, JsonData> metadata() {
return this.metadata;
Expand All @@ -168,52 +168,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
for (Map.Entry<String, JsonData> item0 : this.metadata.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);

}

if (this.causedBy != null) {
generator.writeKey("caused_by");
this.causedBy.serialize(generator, mapper);

}

if (this.reason != null) {
generator.writeKey("reason");
generator.write(this.reason);

}

if (ApiTypeHelper.isDefined(this.rootCause)) {
generator.writeKey("root_cause");
generator.writeStartArray();
for (ErrorCause item0 : this.rootCause) {
item0.serialize(generator, mapper);

}
generator.writeEnd();

}

if (this.stackTrace != null) {
generator.writeKey("stack_trace");
generator.write(this.stackTrace);

}

if (ApiTypeHelper.isDefined(this.suppressed)) {
generator.writeKey("suppressed");
generator.writeStartArray();
for (ErrorCause item0 : this.suppressed) {
item0.serialize(generator, mapper);

}
generator.writeEnd();

}

generator.writeKey("type");
generator.write(this.type);

}

// ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -355,15 +345,23 @@ public final Builder type(String value) {
}

/**
* Additional details about the error
* Additional details about the error.
*
* <p>
* Adds all elements of <code>map</code> to <code>metadata</code>.
* </p>
*/
public final Builder metadata(Map<String, JsonData> map) {
this.metadata = _mapPutAll(this.metadata, map);
return this;
}

/**
* Additional details about the error
* Additional details about the error.
*
* <p>
* Adds an entry to <code>metadata</code>.
* </p>
*/
public final Builder metadata(String key, JsonData value) {
this.metadata = _mapPut(this.metadata, key, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartArray();
for (ErrorCause item0 : this.failures) {
item0.serialize(generator, mapper);

}
generator.writeEnd();

}

generator.writeKey("successful");
generator.write(this.successful);

generator.writeKey("total");
generator.write(this.total);

}

// ---------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
if (this.buildFlavor != null) {
generator.writeKey("build_flavor");
generator.write(this.buildFlavor);

}

generator.writeKey("build_hash");
Expand All @@ -218,7 +217,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

generator.writeKey("number");
generator.write(this.number);

}

// ---------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

generator.writeKey("version");
this.version.serialize(generator, mapper);

}

// ---------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
if (this.clusterName != null) {
generator.writeKey("cluster_name");
generator.write(this.clusterName);

}

generator.writeKey("dangling_indices");
generator.writeStartArray();
for (DanglingIndex item0 : this.danglingIndices) {
item0.serialize(generator, mapper);

}
generator.writeEnd();

if (this.nodes != null) {
generator.writeKey("_nodes");
this.nodes.serialize(generator, mapper);

}

}

// ---------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
if (this.creationDate != null) {
generator.writeKey("creation_date");
generator.write(this.creationDate);

}

generator.writeKey("creation_date_millis");
Expand All @@ -148,10 +147,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartArray();
for (String item0 : this.nodeIds) {
generator.write(item0);

}
generator.writeEnd();

}

// ---------------------------------------------------------------------------------------------
Expand Down
Loading
Loading