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

[Draft] Manual edits in generated code to compiling against v0.4.0 gen output #1959

Closed
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
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"eng/test/mock_transport",
"sdk/storage",
"sdk/storage/azure_storage_blob",
"sdk/storage/storage_blob",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right naming convention. You're azure_storage_blob.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Heath, that is correct. This is currently what is coming right out of the current routes and definitions in https://github.com/Azure/azure-rest-api-specs/blob/feature/blob-tsp/specification/storage/Microsoft.BlobStorage/tspconfig.yaml (aside from some stop-gap edits for NYI features).
As we are on that topic though, is this what you are envisioning regarding the structure?
Current example for where generated BlobBlobClient lives:
sdk/storage/storage_blob/src/generated/clients/blob_blob_client.rs

Desired destination:
sdk/storage/azure_storage_blob/src/generated/clients/blob_blob_client.rs

storage_blob would then be a module containing the generated client and models, and is defined and used in the azure_storage_blob crate? If so, I can pass this information along to Catalina and Joel that we are moving towards that directory structure- as presently this is what the results of the current latest typespec and emitter (v0.4.0) combination outputs: #1958

As for the hand-edits to generated code, that was for illustrating what the desired changes to generated code should look like, and is being tracked here: https://github.com/Azure/typespec-rust/issues/183

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

storage_blob doesn't exist in that scenario. You'd have a azure_storage_blobs (plural; same naming convention as every other language) crate where the clients live in the root. Again, like most other languages. Implementations should be idiomatic, yes, but naming should be idiomatically consistent (i.e. the same, ignoring casing differences). That means for "packages" (nupkgs, wheels, jars, crates, etc.) as well as namespaces/modules.

]

[workspace.package]
Expand Down
3 changes: 2 additions & 1 deletion sdk/storage/storage_blob/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ async-std = { workspace = true }
azure_core = { workspace = true }
serde = { workspace = true }
time = { workspace = true }
typespec_client_core = { workspace = true }
typespec_client_core = { workspace = true, features = ["xml"] }
typespec_macros = { workspace = true }
55 changes: 29 additions & 26 deletions sdk/storage/storage_blob/src/generated/clients/internal_models.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading