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

Show two options for items in folder array [SA-18729] master #165

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tomcdonnell
Copy link
Contributor

@tomcdonnell tomcdonnell commented Feb 25, 2025

Overview

This PR corrects the API documentation for the assessments folder filter.

Previously the docs said the folder filter should contain an array like [{"id": integer, "code": string}, ...]
image

After this PR, the docs say the folder filter should contain an array like [{"id": integer}, {"code": string}, ...]
image

Shortcomings of Redocly

Although I think the API specification is correct after this PR, the rendering by Redocly is still not quite correct.

Problem 1:

The rendering by Redocly suggests that the folders array should contain an object that contains nested objects. This structure in not valid JSON. Example:

// Invalid JSON:
folders: [{{"id": 80}, {"code": "9ENGA"}, ...}]

What we really want is 'An array of objects, each of which specifies either an "id" or a "code".' Example:

// Valid JSON:
folders: [{"id": 80}, {"code": "9ENGA"}, ...]

I added a text description of how the array should be structured to clarify. What I've done is the best we can do I think.

Problem 2:

Note the blank orange square above the second option for the folder filter (the object-only option). No number appears in that square because I marked that option as deprecated. I think this is a styling bug in Redocly. Since the styling does not make clear that the option is deprecated, I changed the description to '(Deprecated)'.

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.

1 participant