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

Improve readability #582

Merged
merged 4 commits into from
Jan 4, 2024
Merged

Conversation

richfab
Copy link
Contributor

@richfab richfab commented Jan 4, 2024

Original PR from @tdelmas: #576

What problem does your proposal solve? Please begin with the relevant issue number. If there is no existing issue, please also describe alternative solutions you have considered.

This PR tries to improve the readability of some points:

  • Objects and array of objects, which are too often described as "An array of objects, each containing the keys below."
  • REQUIRED field inside OPTIONAL objects, which are marked "Conditionally REQUIRED" with the description "REQUIRED if (name of the object) is defined".

Those make the specification too much verbose, thus blurs the important things. For example, when a field is "Conditionally REQUIRED", it's important to clearly understand why, and having too many fields defined as such without a reason make the specification unnecessarily complicated

What is the proposal?

  • Describe the type object, to say once at the top that the keys are defined below.
  • Clarify that a REQUIRED field in an OPTIONAL object is only required when the object is present

Is this a breaking change?

  • Yes
  • No
  • Unsure

@richfab richfab marked this pull request as ready for review January 4, 2024 08:12
@richfab richfab merged commit acf0e6a into MobilityData:clarify-types Jan 4, 2024
1 check passed
richfab added a commit that referenced this pull request Jan 4, 2024
* Improve readability (#582)

* Improve readability

* replace < and > with &lt; and &gt; for display.

* all fields have a definition

---------

Co-authored-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Minor rephrasings

* Remove duplicate of Object definition

* Make field hierarchy explicit

* Adds missing array sub-types

* Fix type Array<ID>

* Update fiedl descriptions for Array<ID>

* Maintain field types alphabetical order

---------

Co-authored-by: Tom <1955774+tdelmas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants