Skip to content

Conversation

@gmlewis
Copy link
Contributor

@gmlewis gmlewis commented Jun 28, 2023

Fixes: #81.

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@samlown samlown added the invalid This doesn't seem right label Sep 6, 2023
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@gmlewis gmlewis changed the title Remove ToSnakeCase for $id field Optionally use CamelCase for $id field Sep 6, 2023
@gmlewis
Copy link
Contributor Author

gmlewis commented Sep 6, 2023

@samlown - thank you for the feedback.
What do you think of this solution?

reflect.go Outdated

// UseCamelCaseForIDs determines if missing IDs will use CamelCase (e.g. `TestUser`)
// or the default snake-case (e.g. `test-user`) when creating the BaseSchemaID.
UseCamelCaseForIDs bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than a specific case, It'd probably be better to use a specific method, which is consistent with some of the other text modifiers.

Something like:

SchemaIDNameFormatter func(id string) string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, is this more like what you are thinking of, @samlown ?

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@gmlewis gmlewis changed the title Optionally use CamelCase for $id field Optionally provide SchemaIDNameFormatter for $id field Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kebab-case $id fields break Python jschon parser

2 participants