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

[Azure Guidelines] Support encoding from StringIndex model to int. #4925

Open
GrahamMThomas opened this issue Jul 17, 2024 · 0 comments
Open
Labels
customization AutoRest C# language generator customization option. v3 Version 3 of AutoRest C# generator.

Comments

@GrahamMThomas
Copy link
Member

GrahamMThomas commented Jul 17, 2024

Describe the issue or request
The latest directive from azure is to support this: https://github.com/microsoft/api-guidelines/blob/685e493d38f8a3875c22336dcd177f4b54dcfb23/azure/Guidelines.md#returning-string-offsets--lengths-substrings

We've implemented the model in the pr here, but the idea from the API Review team is that the SDK's would automatically select the string encoding the language supports and ignore the other two, thereby exposing this field as an int instead of a model.

Azure/azure-sdk-for-net#43913

Within the code:

// Currently
taggerOutput.Offset.Utf16 // int
taggerOutput.Offset //  {"utf8": 10, "utf16":10, "codePoint:10"} - StringIndex model

// Desired
taggerOutput.Offset // int -- While still supporting the serialization of the StringIndex model
@GrahamMThomas GrahamMThomas added v3 Version 3 of AutoRest C# generator. customization AutoRest C# language generator customization option. labels Jul 17, 2024
@GrahamMThomas GrahamMThomas changed the title Support encoding from StringIndex model to int. [Azure Guidelines] Support encoding from StringIndex model to int. Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization AutoRest C# language generator customization option. v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

No branches or pull requests

1 participant