Skip to content

Add $schema to JSON for better VSCode support#49

Merged
MattIPv4 merged 3 commits intobotblock:masterfrom
A5rocks:reference_schemas
Aug 21, 2022
Merged

Add $schema to JSON for better VSCode support#49
MattIPv4 merged 3 commits intobotblock:masterfrom
A5rocks:reference_schemas

Conversation

@A5rocks
Copy link
Copy Markdown
Contributor

@A5rocks A5rocks commented Aug 8, 2022

I'm not completely sure adding $schema is fine, as this changes two (or more, because I may be missing spots) external things:

  • adds $schema when you get a list's info
  • maps the $schema ID to the invalid list ID ../schema/legacy.json for stats posting due to how legacy mapping works -- but this is probably fine since the user could have just provided that URL anyways and $schema is an invalid list ID.

@MattIPv4
Copy link
Copy Markdown
Member

MattIPv4 commented Aug 8, 2022

👀 Does this require a small API change first to drop the $schema prop from the responses in /api/lists, /api/lists/:list and /api/legacy-ids?

@A5rocks
Copy link
Copy Markdown
Contributor Author

A5rocks commented Aug 8, 2022

It could do that (and I would be fine adding that) but really clients shouldn't care about the extra key.

@MattIPv4
Copy link
Copy Markdown
Member

MattIPv4 commented Aug 8, 2022

Clients probably wouldn't care about the extra key, but it would mean that the API schemas would be incorrect as the extra key would be present in the responses. I also don't think it makes much sense to be returning this key in the API responses as it's a relative path that wouldn't point to anywhere useful relative to the API.

@A5rocks
Copy link
Copy Markdown
Contributor Author

A5rocks commented Aug 15, 2022

botblock/api-worker#4

Copy link
Copy Markdown
Member

@MattIPv4 MattIPv4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MattIPv4 MattIPv4 changed the title Better VSCode support Add $schema to JSON for better VSCode support Aug 21, 2022
@MattIPv4 MattIPv4 merged commit 22ff9c2 into botblock:master Aug 21, 2022
@A5rocks A5rocks deleted the reference_schemas branch August 26, 2022 01:24
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