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

[JS Parser] Add support for renamed enums #9768

Open
maorleger opened this issue Feb 4, 2025 · 0 comments · May be fixed by #9769
Open

[JS Parser] Add support for renamed enums #9768

maorleger opened this issue Feb 4, 2025 · 0 comments · May be fixed by #9769
Assignees
Labels

Comments

@maorleger
Copy link
Member

Today our (JS) APIView parser uses the text property to generate the APIView line for a given item.

This works most of the time, but when you rename an item (either on import or export) the text property will contain the original name instead of the publicly visible name.

Example:

// src/generated/index.ts
export enum KnownJsonWebKeyEncryptionAlgorithm { ... }

// src/index.ts
import { KnownJsonWebKeyEncryptionAlgorithm as KnownEncryptionAlgorithm }
export { KnownEncryptionAlgorithm }

output doc-model from APIExtractor:

{
     "canonicalReference": "@azure/keyvault-keys!KnownEncryptionAlgorithms:enum",
     "excerptTokens": [
         {
            "kind": "Content",
            "text": "export declare enum KnownJsonWebKeyEncryptionAlgorithm "
        }
     ],
     "members": [ ]
     "fileUrlPath": "src/generated/models/models.ts",
     "kind": "Enum",
     "name": "KnownEncryptionAlgorithms",
     "preserveMemberOrder": false,
     "releaseTag": "Public"
}

In this case, the APIView will show KnownJsonWebKeyEncryptionAlgorithm but we have all the information needed to display the correct name. This issue tracks making changes to the parser to support this scenario.

@maorleger maorleger self-assigned this Feb 4, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in ApiView Feb 4, 2025
maorleger added a commit to Azure/azure-sdk-for-js that referenced this issue Feb 4, 2025
### Packages impacted by this PR

@azure/keyvault-keys

### Issues associated with this PR

Resolves #32636
Resolves #32751

### Describe the problem that is addressed by this PR

This PR accomplishes two goals:

1. Use generated enum names instead of overwriting them with our
hand-authored ones in keyvault-keys
2. Adds a warning about using RSA1_5 and RSA-OAEP by proxy of (1) -
exposing the generated enum names directly


Note: APIView diff requires a fix to the parser (see Azure/azure-sdk-tools#9768)
@maorleger maorleger linked a pull request Feb 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

1 participant