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

Fix docs for union member casing #1719

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

abuzar08
Copy link

@abuzar08 abuzar08 commented Jan 13, 2025

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?

@@ -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
Copy link

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.

Copy link
Author

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.

@@ -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).
Copy link

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.

Copy link
Author

Choose a reason for hiding this comment

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

updated.

@dtobin dtobin changed the title Made union names PascalCase as mentioned they should be Fix docs for union member casing Jan 14, 2025
@@ -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).
Copy link

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!

Copy link
Author

Choose a reason for hiding this comment

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

ack - done!

@abuzar08 abuzar08 self-assigned this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants