Skip to content

Conversation

@rpocklin
Copy link
Collaborator

@rpocklin rpocklin commented Oct 22, 2025

For review

Example (before):

[JsonConverter(typeof(StringEnumConverter))]
public enum AccountType
{
    [EnumMember(Value = "BANK")]
    BANK = 0,
    
    [EnumMember(Value = "CURRENT")]
    CURRENT = 1,
    
    [EnumMember(Value = "EQUITY")]
    EQUITY = 2,
    // ...
}

Example (after):

public class AccountType {
    public string Value { get; set; }
    
    // Known constants
    public static readonly string BANK = "BANK";
    public static readonly string CURRENT = "CURRENT";
    public static readonly string EQUITY = "EQUITY";
}

@github-actions
Copy link

PETOSS-831

@github-actions
Copy link

Thanks for raising an issue, a ticket has been created to track your request

@ryanNexus
Copy link
Contributor

ryanNexus commented Oct 22, 2025

need to merge main to this branch and fix linting please so all checks pass otherwise LTGM 😄

- Added x-enum-varnames for better code generation
- Provides PascalCase names for enum values in generated code
- Improves developer experience with more readable enum names
- Affects 49 Closed enum schemas across 8 files
@rpocklin rpocklin marked this pull request as draft October 26, 2025 21:58
@rpocklin
Copy link
Collaborator Author

Closing for now - we should consider the recommended approach of defining string enums using the new approach in OAS 3.1 (see here)

@rpocklin rpocklin closed this Nov 14, 2025
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.

4 participants