-
Notifications
You must be signed in to change notification settings - Fork 346
http-client-java, fix list result property in parent #10017
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
Merged
weidongxu-microsoft
merged 11 commits into
microsoft:main
from
weidongxu-microsoft:http-client-java_fix-property-in-parent
Mar 16, 2026
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
95cb729
fix
weidongxu-microsoft 81daa4d
test case
weidongxu-microsoft fbe82c3
changelog
weidongxu-microsoft 40463cd
regen
weidongxu-microsoft 47003c5
fix lint
weidongxu-microsoft 2b84dcb
comment in test
weidongxu-microsoft 8c70643
add test
weidongxu-microsoft f579baf
paged model need to be public, if its child is public
weidongxu-microsoft 806b1ab
test case
weidongxu-microsoft a4ebe79
regen
weidongxu-microsoft e7e2427
Potential fix for pull request finding
weidongxu-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/http-client-java_fix-property-in-parent-2026-2-13-15-41-25.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| changeKind: fix | ||
| packages: | ||
| - "@typespec/http-client-java" | ||
| --- | ||
|
|
||
| Fix result segments like "value" not found if defined in parent model. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
.../main/java/tsptest/armstreamstyleserialization/fluent/models/ListResultSummary2Inner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| // Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
|
||
| package tsptest.armstreamstyleserialization.fluent.models; | ||
|
|
||
| import com.azure.core.annotation.Immutable; | ||
| import com.azure.core.util.logging.ClientLogger; | ||
| import com.azure.json.JsonReader; | ||
| import com.azure.json.JsonToken; | ||
| import com.azure.json.JsonWriter; | ||
| import java.io.IOException; | ||
| import java.util.List; | ||
| import tsptest.armstreamstyleserialization.models.ListResult2; | ||
| import tsptest.armstreamstyleserialization.models.Result; | ||
|
|
||
| /** | ||
| * The ListResultSummary2 model. | ||
| */ | ||
| @Immutable | ||
| public final class ListResultSummary2Inner extends ListResult2 { | ||
| /* | ||
| * The summary property. | ||
| */ | ||
| private String summary; | ||
|
|
||
| /* | ||
| * The nextLink property. | ||
| */ | ||
| private String nextLink; | ||
|
|
||
| /* | ||
| * The items property. | ||
| */ | ||
| private List<Result> items; | ||
|
|
||
| /** | ||
| * Creates an instance of ListResultSummary2Inner class. | ||
| */ | ||
| private ListResultSummary2Inner() { | ||
| } | ||
|
|
||
| /** | ||
| * Get the summary property: The summary property. | ||
| * | ||
| * @return the summary value. | ||
| */ | ||
| public String summary() { | ||
| return this.summary; | ||
| } | ||
|
|
||
| /** | ||
| * Get the nextLink property: The nextLink property. | ||
| * | ||
| * @return the nextLink value. | ||
| */ | ||
| @Override | ||
| public String nextLink() { | ||
| return this.nextLink; | ||
| } | ||
|
|
||
| /** | ||
| * Get the items property: The items property. | ||
| * | ||
| * @return the items value. | ||
| */ | ||
| @Override | ||
| public List<Result> items() { | ||
| return this.items; | ||
| } | ||
|
|
||
| /** | ||
| * Validates the instance. | ||
| * | ||
| * @throws IllegalArgumentException thrown if the instance is not valid. | ||
| */ | ||
| @Override | ||
| public void validate() { | ||
| if (items() == null) { | ||
| throw LOGGER.atError() | ||
| .log(new IllegalArgumentException("Missing required property items in model ListResultSummary2Inner")); | ||
| } else { | ||
| items().forEach(e -> e.validate()); | ||
| } | ||
| } | ||
|
|
||
| private static final ClientLogger LOGGER = new ClientLogger(ListResultSummary2Inner.class); | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
| jsonWriter.writeStartObject(); | ||
| jsonWriter.writeArrayField("items", items(), (writer, element) -> writer.writeJson(element)); | ||
| jsonWriter.writeStringField("nextLink", nextLink()); | ||
| jsonWriter.writeStringField("summary", this.summary); | ||
| return jsonWriter.writeEndObject(); | ||
| } | ||
|
|
||
| /** | ||
| * Reads an instance of ListResultSummary2Inner from the JsonReader. | ||
| * | ||
| * @param jsonReader The JsonReader being read. | ||
| * @return An instance of ListResultSummary2Inner if the JsonReader was pointing to an instance of it, or null if it | ||
| * was pointing to JSON null. | ||
| * @throws IllegalStateException If the deserialized JSON object was missing any required properties. | ||
| * @throws IOException If an error occurs while reading the ListResultSummary2Inner. | ||
| */ | ||
| public static ListResultSummary2Inner fromJson(JsonReader jsonReader) throws IOException { | ||
| return jsonReader.readObject(reader -> { | ||
| ListResultSummary2Inner deserializedListResultSummary2Inner = new ListResultSummary2Inner(); | ||
| while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
| String fieldName = reader.getFieldName(); | ||
| reader.nextToken(); | ||
|
|
||
| if ("items".equals(fieldName)) { | ||
| List<Result> items = reader.readArray(reader1 -> Result.fromJson(reader1)); | ||
| deserializedListResultSummary2Inner.items = items; | ||
| } else if ("nextLink".equals(fieldName)) { | ||
| deserializedListResultSummary2Inner.nextLink = reader.getString(); | ||
| } else if ("summary".equals(fieldName)) { | ||
| deserializedListResultSummary2Inner.summary = reader.getString(); | ||
| } else { | ||
| reader.skipChildren(); | ||
| } | ||
| } | ||
|
|
||
| return deserializedListResultSummary2Inner; | ||
| }); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.