-
Notifications
You must be signed in to change notification settings - Fork 334
feat(compiler): support to assign bytes for @example decorators
#9277
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?
feat(compiler): support to assign bytes for @example decorators
#9277
Conversation
| type Value, | ||
| } from "../core/types.js"; | ||
| import { getEncode, resolveEncodedName, type EncodeData } from "./decorators.js"; | ||
| import { uint8ArrayToBase64 } from "./Uint8ArrayBase64Polyfill.js"; |
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.
If you don't want to copy and paste the polyfill, I can also install a polyfill library.
packages/compiler/lib/intrinsics.tsp
Outdated
| * const bytes = bytes.fromString("TypeSpec"); | ||
| * ``` | ||
| */ | ||
| init fromString(value: string); |
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 if we have this constructor it should be more explicit on what is the string(include the encoding)
cc @witemple-msft what do you think? this also could be a good use case for a parameterized constructor
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.
Sorry for the late reply.
I've added the parameter of character code as the second argument. Are there any other character codes that should be supported?
closes #7442
Importing
examplefrom OpenAPI3 document needs this feature.