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

Keep enum const case the same as defined in schema #213

Merged
merged 1 commit into from
Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ data class TypeDeclaration(
fun TypeSpec.Builder.addEnumConstants(): TypeSpec.Builder {
values?.forEach {
if (it.description.isNullOrEmpty()) {
addEnumConstant(it.name.toUpperCase())
addEnumConstant(it.name)
} else {
addEnumConstant(it.name.toUpperCase(), TypeSpec.anonymousClassBuilder("")
addEnumConstant(it.name, TypeSpec.anonymousClassBuilder("")
.addJavadoc("\$L\n", it.description)
.build())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import javax.annotation.Generated;

/**
* The episodes in the Star War$S trilogy
* The episodes in the Star Wars trilogy (with special symbol $S)
*/
@Generated("Apollo GraphQL")
public enum Episode {
/**
* Star War$S Episode IV: A New Hope, released in 1977.
* Star Wars Episode IV: A New Hope, released in 1977. (with special symbol $S)
*/
NEWHOPE,

Expand All @@ -18,7 +18,7 @@ public enum Episode {
EMPIRE,

/**
* Star Wars Episode VI: Return of the Jedi, released in 1983.
* Star Wars Episode VI: Return of the Jedi, released in 1983. (JEDI in lowercase)
*/
JEDI
jedi
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
{
"kind": "EnumType",
"name": "Episode",
"description": "The episodes in the Star War$S trilogy",
"description": "The episodes in the Star Wars trilogy (with special symbol $S)",
"values": [
{
"name": "NEWHOPE",
"description": "Star War$S Episode IV: A New Hope, released in 1977."
"description": "Star Wars Episode IV: A New Hope, released in 1977. (with special symbol $S)"
},
{
"name": "EMPIRE",
"description": "Star Wars Episode V: The Empire Strikes Back, released in 1980."
},
{
"name": "JEDI",
"description": "Star Wars Episode VI: Return of the Jedi, released in 1983."
"name": "jedi",
"description": "Star Wars Episode VI: Return of the Jedi, released in 1983. (JEDI in lowercase)"
}
]
}
Expand Down