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

Consistent formatting for JSON type identifiers #460

Open
Whathecode opened this issue Mar 2, 2024 · 0 comments
Open

Consistent formatting for JSON type identifiers #460

Whathecode opened this issue Mar 2, 2024 · 0 comments
Labels
enhancement Nice to have, non-functional requirements.

Comments

@Whathecode
Copy link
Member

Whathecode commented Mar 2, 2024

@bardram observed the following:

Another question is - when do you use lower versus upper case - what is the difference between these two?

"attribute": {
"__type": "dk.cachet.carp.common.application.users.ParticipantAttribute.DefaultParticipantAttribute",
"inputDataType": "dk.cachet.carp.input.sex"
}
Why is sex lower case and DefaultParticipantAttribute upper case?

This is fairly arbitrary:

That's unfortunately something that leaks out from the implementation. The PascalCase types are types in the codebase using default polymorphic serialization, which just uses the namespace.ClassName. The lowercase types are data types, which are handled differently and registered manually, since they are so central to the framework. I think it would make sense that at least all extendable types (data, devices, tasks) adopt this lowercase style, but I see that is not the case atm (devices use PascalCase).

For consistency, it would make sense to align on common formatting for all CARP types. For backwards compatibility, this would need API migrations, however!

@Whathecode Whathecode added the enhancement Nice to have, non-functional requirements. label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Nice to have, non-functional requirements.
Projects
None yet
Development

No branches or pull requests

1 participant