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

Add example parsing from comments for adding to the spec examples. En… #7

Closed
wants to merge 7 commits into from

Conversation

jdmcgrath
Copy link

…ables better examples in UI

… example content and descriptions within comment sections of a schema.

In details, the changes cover:

- Adding logic to incorporate the example and description into the schema. This happens when parsing comments associated with fields within a type.
- Adjusting `parseDescriptionAndExampleFromComments` function: whenever an "Example:" is located, the function trims spaces and quotes, and strips the example from the description. When no example is found, the function returns the unaltered description.
- Within `parseExample` function, we've added conversion logic to turn the string comment into the respective type of the schema field. This only occurs when the schemaType is specified as "string".

These changes were deemed necessary to properly process examples and adhere to relevant specifications, thus improving our schema's quality and usability.
@jdmcgrath jdmcgrath closed this Nov 30, 2023
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