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

Node.js doesn't honor x-ms-enum values field #2706

Closed
matthchr opened this issue Nov 11, 2017 · 3 comments
Closed

Node.js doesn't honor x-ms-enum values field #2706

matthchr opened this issue Nov 11, 2017 · 3 comments

Comments

@matthchr
Copy link
Member

According to here there is a values collection supported on enums, for specifying doc-strings for the individual enum values (among other things). But the generated Node code doesn't actually use these doc strings at all.

For example, this snippet of Swagger (from the Azure Batch swagger specification):

            "values": [
              {
                "value": "currentuser",
                "description": "Certificates should be installed to the CurrentUser certificate store.",
                "name": "currentUser"
              },
              {
                "value": "localmachine",
                "description": "Certificates should be installed to the LocalMachine certificate store.",
                "name": "localMachine"
              }
            ]
          }

But in Node, we don't actually define the enums anywhere, so this extra documentation gets lost, which is unfortunate because in some of the strongly typed languages (i.e. C#) this is correctly rendered onto the generated enums and makes the experience for the customer significantly better.

Python has a similar issue, but in Python there is a place to put the docs: See #2704

@matthchr
Copy link
Member Author

@amarzavery

@matthchr
Copy link
Member Author

matthchr commented Nov 14, 2017

I spoke with @amarzavery about this and he said it was a pretty easy fix. It sounds like it should be fixed in the next sprint.

@OzBob
Copy link

OzBob commented Jul 9, 2019

The current version 'version: 2.0.4283; node: v12.4.0', throws exceptions: "Values specified by 'enum' mismatch those specified by 'x-ms-enum' (name: 'Reason'): 'AccountNameInvalid', 'AlreadyExists' vs '0', '1'"

When processing: https://github.com/OzBob/autorest/blob/master/Samples/1d-common-settings/base/folder/generated/AwesomeNamespace.json

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

No branches or pull requests

4 participants