-
Notifications
You must be signed in to change notification settings - Fork 316
http-client-java, continuationToken can be used in azurev2 #8601
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -528,10 +528,11 @@ export class CodeModelBuilder { | |
// skip models under "com.azure.core." in java, or "Azure." in typespec, if branded | ||
!( | ||
( | ||
this.isBranded() && | ||
(schema.language.java?.namespace?.startsWith("com.azure.core.") || | ||
schema.language.default?.namespace?.startsWith("Azure.") || | ||
schema.language.java?.namespace?.startsWith("com.azure.v2.core.") || | ||
(this.isBranded() && | ||
(schema.language.java?.namespace?.startsWith("com.azure.core.") || | ||
schema.language.default?.namespace?.startsWith("Azure.") || | ||
schema.language.java?.namespace?.startsWith("com.azure.v2.core."))) || | ||
(!this.isBranded() && | ||
schema.language.java?.namespace?.startsWith("io.clientcore.core.")) | ||
) // because azure core v2 uses clientcore types | ||
) | ||
|
@@ -1072,6 +1073,22 @@ export class CodeModelBuilder { | |
? pageItemsResponseProperty[0].serializedName | ||
: undefined; | ||
|
||
if ( | ||
this.isAzureV1() && | ||
(pageItemsResponseProperty === undefined || pageItemsResponseProperty.length > 1) | ||
) { | ||
// TCGC should have verified that pageItems exists | ||
|
||
// Azure V1 does not support nested page items | ||
reportDiagnostic(this.program, { | ||
code: "nested-page-items-not-supported", | ||
target: | ||
sdkMethod.response.resultSegments?.[sdkMethod.response.resultSegments.length - 1] | ||
?.__raw ?? NoTarget, | ||
}); | ||
return; | ||
} | ||
|
||
// nextLink | ||
// TODO: nextLink can also be a response header, similar to "sdkMethod.pagingMetadata.continuationTokenResponseSegments" | ||
const nextLinkResponseProperty = findResponsePropertySegments( | ||
|
@@ -1088,7 +1105,7 @@ export class CodeModelBuilder { | |
let continuationTokenParameter: Parameter | undefined; | ||
let continuationTokenResponseProperty: Property[] | undefined; | ||
let continuationTokenResponseHeader: HttpHeader | undefined; | ||
if (!this.isBranded()) { | ||
if (!this.isAzureV1()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. azurev2 can have same generated code, as unbranded |
||
// parameter would either be query or header parameter, so taking the last segment would be enough | ||
const continuationTokenParameterSegment = | ||
sdkMethod.pagingMetadata.continuationTokenParameterSegments?.at(-1); | ||
|
@@ -1807,7 +1824,10 @@ export class CodeModelBuilder { | |
} | ||
} | ||
|
||
const schemaName = groupToRequestConditions ? "RequestConditions" : "MatchConditions"; | ||
let schemaName = groupToRequestConditions ? "RequestConditions" : "MatchConditions"; | ||
if (!this.isBranded()) { | ||
schemaName = "Http" + schemaName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. they have different name in clientcore... |
||
} | ||
const schemaDescription = groupToRequestConditions | ||
? "Specifies HTTP options for conditional requests based on modification time." | ||
: "Specifies HTTP options for conditional requests."; | ||
|
Uh oh!
There was an error while loading. Please reload this page.