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

[📝 Docs]: Simplify examples on getting started page #658

Open
1 task done
bhavukkalra opened this issue Apr 15, 2024 · 2 comments
Open
1 task done

[📝 Docs]: Simplify examples on getting started page #658

bhavukkalra opened this issue Apr 15, 2024 · 2 comments
Labels
📝 Documentation Indicates improvements or additions to documentation. Status: Triage This is the initial status for an issue that requires triage.

Comments

@bhavukkalra
Copy link
Contributor

bhavukkalra commented Apr 15, 2024

What Docs changes are you proposing?

Emerged out of the original issue #653.
Page - getting-started-step-by-step

This issue tracks the progress on having simpler workings while explaining required keys to a new user onboarded.

Currently - explanation for required keys of "productId", "productName" is kinda confusing. The docs does mentions that they are required but it can't be observed in the changes made.
It is only some time later that we see the line of code

"required": [ "productId", "productName", "price]" 

Where it starts to make sense.

A better way to write it would be

  "properties": {
    "productId": {
      "description": "The unique identifier for a product",
      "type": "integer"
    }
  },

  "required": ["productId"]

i.e Update the required key as we go along adding new attributes. Not all at once (which is currently in the docs). As it makes a proper flow of what is written in text and simultaneously in code

Original comment - #653 (comment)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bhavukkalra bhavukkalra added Status: Triage This is the initial status for an issue that requires triage. 📝 Documentation Indicates improvements or additions to documentation. labels Apr 15, 2024
@chidiadi01
Copy link

chidiadi01 commented Apr 21, 2024

Hi @bhavukkalra, I'd love to work on this issue.

chidiadi01 added a commit to chidiadi01/json-schema-website that referenced this issue Apr 22, 2024
…llowing changes were done:

    - Added 'required' keyword to all code samples in the 'Define properties' section
    - Reworded and restructured the 'Define properties' section for better understanding, and removed the 'Add the properties object' sub-section because it was unnecessary.
    - Added an infobox to give more information about optional properties
chidiadi01 added a commit to chidiadi01/json-schema-website that referenced this issue Apr 22, 2024
…llowing changes were done:

    - Added 'required' keyword to all code samples in the 'Define properties' section
    - Reworded and restructured the 'Define properties' section for better understanding, and removed the 'Add the properties object' sub-section because it was unnecessary.
    - Added an infobox to give more information about optional properties
@gregsdennis
Copy link
Member

I think the page is fine as it is. It presents a journey that I think is more akin to what a developer will experience building a schema: you define the properties, then you say which ones are required. In JSON Schema these are two different constraints, so it makes sense to help the developer start thinking that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 Documentation Indicates improvements or additions to documentation. Status: Triage This is the initial status for an issue that requires triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants