Skip to content

Instantly share code, notes, and snippets.

@moritztim
Created January 13, 2025 23:04
Show Gist options
  • Save moritztim/fc64ecc1faea791de64214a2f9d4828d to your computer and use it in GitHub Desktop.
Save moritztim/fc64ecc1faea791de64214a2f9d4828d to your computer and use it in GitHub Desktop.
JSON Schema describing the formatting of a multi-word identifier
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "string",
"title": "String Case",
"description": "Formatting of a multi-word identifier",
"default": "snake",
"$comment": "Based on stringcase.org",
"oneOf": [
{
"oneOf": [
{
"const": "snake",
"title": "snake_case"
},
{
"const": "lowercaseWithUnderscores",
"title": "lowercase_with_underscores"
}
]
},
{
"oneOf": [
{
"const": "constant",
"title": "CONSTANT_CASE"
},
{
"const": "upperSnake",
"title": "UPPER_SNAKE_CASE"
},
{
"const": "screamingSnake",
"title": "SCREAMING_SNAKE_CASE"
}
]
},
{
"oneOf": [
{
"const": "kebab",
"title": "kebab-case"
},
{
"const": "dash",
"title": "dash-case"
},
{
"const": "hyphen",
"title": "hyphen-case"
}
]
},
{
"oneOf": [
{
"const": "cobol",
"title": "COBOL-CASE"
},
{
"const": "upperKebab",
"title": "UPPER-KEBAB-CASE"
}
]
},
{
"const": "train",
"title": "Train-Case"
},
{
"const": "flat",
"title": "flatcase"
},
{
"const": "upperflat",
"title": "UPPERFLATCASE"
},
{
"oneOf": [
{
"const": "camel",
"title": "camelCase"
},
{
"const": "mixed",
"title": "mixedCase"
},
{
"const": "lowerCamel",
"title": "lowerCamelCase"
}
]
},
{
"oneOf": [
{
"const": "pascal",
"title": "PascalCase"
},
{
"const": "upperCamel",
"title": "UpperCamelCase"
}
]
},
{
"const": "lower",
"title": "lower case"
},
{
"const": "upper",
"title": "UPPER CASE"
},
{
"const": "title",
"title": "Title Case"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment