-
Notifications
You must be signed in to change notification settings - Fork 75
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
Binder models tcgc #2759
base: main
Are you sure you want to change the base?
Binder models tcgc #2759
Conversation
...spec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/operations/index.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
...s/typespec-test/test/anomalyDetector/generated/typespec-ts/review/ai-anomaly-detector.api.md
Outdated
Show resolved
Hide resolved
} | ||
|
||
// @public (undocumented) | ||
export interface DeleteDataRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be a new model. not sure where it comes from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is this expected?
...st/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md
Outdated
Show resolved
Hide resolved
...st/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md
Outdated
Show resolved
Hide resolved
...ec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/dataProducts/index.ts
Outdated
Show resolved
Hide resolved
...st/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/api/eventGridContext.ts
Show resolved
Hide resolved
...pespec-test/test/contentsafety_modular/generated/typespec-ts/review/ai-content-safety.api.md
Outdated
Show resolved
Hide resolved
...pespec-test/test/contentsafety_modular/generated/typespec-ts/src/api/contentSafetyContext.ts
Outdated
Show resolved
Hide resolved
...pespec-test/test/contentsafety_modular/generated/typespec-ts/review/ai-content-safety.api.md
Outdated
Show resolved
Hide resolved
...ec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/dataProducts/index.ts
Outdated
Show resolved
Hide resolved
92c5a25
to
1d0e542
Compare
@@ -439,6 +455,10 @@ export interface NetworkAnalyticsClientOptionalParams extends ClientOptions { | |||
apiVersion?: string; | |||
} | |||
|
|||
// @public (undocumented) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs missing.
...es/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/models/deserialization/propertyType.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/models/deserialization/propertyType.md
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/review/openai_modular.api.md
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/index.ts
Outdated
Show resolved
Hide resolved
timestamp_granularities: !item["timestampGranularities"] | ||
? item["timestampGranularities"] | ||
: item["timestampGranularities"].map((p: any) => { | ||
return p; | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like this is a no-op? Could we just generate timestamp_granularities: item["timestampGranularities"]
or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but I was actually struggling between the option of increasing the codegen implementation/runtime complexity by detecting if we need to generate the serializer/deserializer for each type recursively with the risk of some type we may be missing, and the option of just generate the serializer/deserializer any way.
functions: !item["functions"] | ||
? item["functions"] | ||
: functionDefinitionArraySerializer(item["functions"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it work to simplify this pattern to something like:
{
// ...
functions: item["functions"] && functionDefinitionArraySerializer(item["functions"]),
}
or is there a case where that wouldn't do the right thing?
@@ -990,9 +1034,6 @@ export interface PineconeFieldMappingOptions { | |||
urlField?: string; | |||
} | |||
|
|||
// @public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expected that this is being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be expected.
currently, we will filter the generated types based on their usage here https://github.com/joheredi/autorest.typescript/blob/0d4a12d15dbcfdff103e85804b0fc5fe23c512d8/packages/typespec-ts/src/modular/emitModels.ts#L100-L107 , And in tcgc, this version enum has a special UsageFlag https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/src/interfaces.ts#L703. that's why it gets filtered out.
We have an issue for version union #2680, which we have agreed to generate the api version type as string, but we will generate a KnownXXX enum for it as document purpose.
Because issue #2680 is not completed yet, and if I remember correctly, in our existing releases, @kazrael2119 has manually removed all the version unions when preparing the prs. so, it should not be a breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgetu I think you have the same comment about this. Let me know if you have different thoughts here.
packages/typespec-ts/src/modular/serialization/buildDeserializerFunction.ts
Show resolved
Hide resolved
packages/typespec-ts/src/modular/serialization/buildDeserializerFunction.ts
Show resolved
Hide resolved
packages/typespec-ts/src/modular/serialization/buildSerializerFunction.ts
Outdated
Show resolved
Hide resolved
createOrReplace(name: string, resource: User, options?: CreateOrReplaceOptionalParams): PollerLike<OperationState<User>, User>; | ||
delete(name: string, options?: DeleteOptionalParams): PollerLike<OperationState<void>, void>; | ||
export(name: string, format: string, options?: ExportOptionalParams): PollerLike<OperationState<ExportedUser>, ExportedUser>; | ||
createOrReplace(name: string, resource: User, options?: CreateOrReplaceOptionalParams): PollerLike<OperationState_2<User>, User>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocking: Naming is broken here
@@ -94,6 +110,10 @@ export declare interface PageSettings { | |||
|
|||
export declare type ProvisioningState = ResourceProvisioningState | "Provisioning" | "Updating" | "Deleting" | "Accepted"; | |||
|
|||
export declare type ProvisioningState_1 = ResourceProvisioningState | "Provisioning" | "Updating" | "Deleting" | "Accepted"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check: Type is being generated multiple times. Is this a namespace problem, or an emitter bug?
...-ts/test/modularIntegration/generated/client/structure/client-operation-group/src/index.d.ts
Show resolved
Hide resolved
packages/typespec-ts/test/modularIntegration/generated/client/structure/default/src/index.d.ts
Outdated
Show resolved
Hide resolved
...spec-ts/test/modularIntegration/generated/type/property/additional-properties/src/index.d.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel Getu <dgetu00@gmail.com>
@@ -313,6 +318,10 @@ export interface ErrorAdditionalInfo { | |||
readonly type?: string; | |||
} | |||
|
|||
// @public | |||
export interface ErrorAdditionalInfoInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new orphan model?
Versions, | ||
} from "./models/index.js"; | ||
export { | ||
NetworkAnalyticsContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we export NetworkAnalyticsContext to public in classical layer? I think this is implementation detail in this layer.
@@ -34,7 +35,7 @@ export interface BrokerProperties { | |||
// @public | |||
export interface CloudEvent { | |||
data?: any; | |||
dataBase64?: Uint8Array; | |||
data_base64?: Uint8Array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a fan of that we should do property normalization especially for azure scope. This could help us generate more idiomatic SDKs. And could ensure consistant property naming style cross SDKs.
TypeSpec authors could have their own style of property naming convention and that style may or may not be suitable for JS/TS language style. So property normalization could help
- ensure all properties only have one style
- property naming style is JS/TS style
- good property name could be better discoverable by user intellisense
- a typespec property may not be a valid ts property
Summary of Changes in this PR
a. generate one copy of models outside of the subclient folder of multi-client case.
b. move operation options inside the api folder.
TCGC related issues