Skip to content

fix: lowercase CLI enum values in HelpText and error messages (Group 3)#3444

Draft
souvikghosh04 wants to merge 1 commit intomainfrom
Usr/sogh/grp3-cli-casing
Draft

fix: lowercase CLI enum values in HelpText and error messages (Group 3)#3444
souvikghosh04 wants to merge 1 commit intomainfrom
Usr/sogh/grp3-cli-casing

Conversation

@souvikghosh04
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 commented Apr 14, 2026

Summary

Fixes 4 issues where CLI --help text and error messages showed PascalCase or UPPERCASE enum values instead of the lowercase values required by the JSON schema.

The JSON serialization layer already produces lowercase (via EnumMemberJsonEnumConverterFactory), so these fixes align the CLI display layer to match.

Issues Addressed

Issue Option CLI Showed Schema Requires Fix
#3361 --host-mode (init) Development or Production development or production HelpText lowercased
#3362 --rest.methods (add/update) [GET, POST, PUT, PATCH, DELETE] [get, post, put, patch, delete] HelpText lowercased
#3363 --graphql.operation (add/update) [Query, Mutation] [query, mutation] HelpText lowercased
#3364 --graphql.operation (add/update) Same as #3363 Same as #3363 Same fix

Files Changed

File Changes
src/Cli/Commands/InitOptions.cs host-mode HelpText: lowercase enum values
src/Cli/Commands/EntityOptions.cs rest.methods and graphql.operation HelpText: lowercase enum values
src/Cli/Utils.cs REST method and GraphQL operation error messages: lowercase enum names

Testing

  • AddEntityTests: 60 passed, 0 failed
  • UpdateEntityTests: 94 passed, 0 failed
  • EndToEndTests: 138 passed, 0 failed, 3 skipped
  • Build: 0 warnings, 0 errors

Fix 4 issues where CLI help text and error messages showed PascalCase
or uppercase enum values instead of the lowercase values required by
the JSON schema:

InitOptions.cs:
- host-mode HelpText: 'Development or Production' -> 'development or
  production' (#3361)

EntityOptions.cs:
- rest.methods HelpText: '[GET, POST, ...]' -> '[get, post, ...]' (#3362)
- graphql.operation HelpText: '[Query, Mutation]' -> '[query, mutation]'
  (#3363, #3364)

Utils.cs:
- REST method error message: Enum.GetNames() -> lowercased names
- GraphQL operation error message: enum ToString() -> lowercased strings
@souvikghosh04 souvikghosh04 self-assigned this Apr 14, 2026
@souvikghosh04 souvikghosh04 moved this from Todo to In Progress in Data API builder Apr 14, 2026
@souvikghosh04 souvikghosh04 added this to the April 2026 milestone Apr 14, 2026
@souvikghosh04 souvikghosh04 linked an issue Apr 14, 2026 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Parent] Group 3: CLI Incorrect Casing

1 participant