-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix docs for union member casing #1719
base: master
Are you sure you want to change the base?
Conversation
docs/spec/conjure_definitions.md
Outdated
@@ -233,8 +233,8 @@ It is common for a generator to also generate a visitor interface for each union | |||
Payload: | |||
package: com.palantir.example | |||
union: | |||
serviceLog: ServiceLog | |||
notAServiceLog: RequestLog | |||
ServiceLog: ServiceLog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change should be the inverse - the docs above are incorrect, and union names must be lowerCamelCase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack - flipped the inconsistency Correction.
docs/spec/conjure_definitions.md
Outdated
@@ -222,7 +222,7 @@ Definition for a union complex data type. | |||
|
|||
Field | Type | Description | |||
---------- | ---- | ----------- | |||
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in PascalCase. | |||
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in [camelCase](https://developer.mozilla.org/en-US/docs/Glossary/Camel_case). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Union names need to be specifically lowerCamelCase. UpperCamelCase is not supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
docs/spec/conjure_definitions.md
Outdated
@@ -222,7 +222,7 @@ Definition for a union complex data type. | |||
|
|||
Field | Type | Description | |||
---------- | ---- | ----------- | |||
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in PascalCase. | |||
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in [lowerCamelCase](https://www.techtarget.com/whatis/definition/lowerCamelCase). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This website doesn't look authoritative; we should omit the link here. lowerCamelCase
is used elsewhere in this repo without reference - I think it's common enough not to cause confusion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack - done!
Before this PR
The definitions mentions that "Union names MUST be in PascalCase", however the example given below had the union names in camelCase.
After this PR
==COMMIT_MSG==
==COMMIT_MSG==
The example now has union names in PascalCase, conforming to the aforementioned convention.The docs now mention that the union Names must be in camelCase.Possible downsides?