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

Deprecate getAssetEmitter and recommend calling createAssetEmitter directly #3516

Merged

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Jun 4, 2024

fix #3397

Problem with calling getAssetEmitter is it create an asset emitter with the instance of the compiler used in the compilation and not the instance of the compiler defined in the type emitter necessarly. This cause issue with instanceof checks which are then not the exact same class as its loaded form different instance of the compiler
Calling createAssetEmitter solve the issue because it is imported in teh context of the emitter package and will use the emitter package version

@azure-sdk
Copy link
Collaborator

azure-sdk commented Jun 4, 2024

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/json-schema
  • @typespec/openapi3
Show changes

@typespec/compiler - fix ✏️

Deprecate getAssetEmitter and recommend calling createAssetEmitter directly

@typespec/json-schema - fix ✏️

Fix issue that could result in invalid document generation when running tsp compile from another directory

@typespec/openapi3 - fix ✏️

Fix issue that could result in invalid document generation when running tsp compile from another directory

@azure-sdk
Copy link
Collaborator

You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/3516/

Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/3516/

@timotheeguerin timotheeguerin added this pull request to the merge queue Jul 1, 2024
Merged via the queue into microsoft:main with commit 4cfb2c2 Jul 1, 2024
21 checks passed
@timotheeguerin timotheeguerin deleted the deprecate/get-asset-emitter branch July 1, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: invalid openapi output running from github actions on ubuntu-latest
3 participants