-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
Is your feature request related to a problem? Please describe.
The spec API is not consistent with this expectation for the nullability and optionality of objects.
For example, the Task class
will always instantiate its history and artifact with (potentially empty) collections while its metatada can be null.
The API should be consistent unless there is a good reason not to.
In that case, the metadata should also be an empty Map if the parameter is null.
For case where we want to record that a field can have a value or be null, we could also leverage Optional.
For example, in TaskStatus, the message is optional. We could make its type Optional<String> to constrain its contract.
Describe the solution you'd like
Update the spec API to:
- be consistent with the nullabitity of fields (especially collections)
- use the
Optionaltype for optional fields - update the javadoc when there is exception to this general rule
Describe alternatives you've considered
No response
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels