Skip to content

Update meta.json #4676

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Update meta.json #4676

wants to merge 6 commits into from

Conversation

zx80
Copy link

@zx80 zx80 commented Jul 2, 2025

Fix to obvious schema issues. There are others less straightforward to fix, though.

Fix to obvious schema issues. There are others less straightforward to fix, though.
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

Sorry but I do not see these errors as obvious. If you can add at least one positive/negative tests, it would much easier to understand them and also to prevent further changes that might break the schema.

@ssbarnea ssbarnea marked this pull request as draft July 4, 2025 15:16
@zx80
Copy link
Author

zx80 commented Jul 5, 2025

Sorry but I do not see these errors as obvious.

The current schema itself is obviously wrong because what is written does not make sense from a semantical point of view. However, how to fix it depends on the underlying intention which failed to materialize in the schema, and is really just guessing from my part because I do not know the real/detailed expectations.

For these two fixes on the meta json file, which seems to correspond more or less to this description and this other:

  1. The else does not have a corresponding if thus is dead code, which I consider an obvious error. My guess is that it is badly nested and belongs to the if/then which is just above, but maybe it should just be removed.

  2. Having additionalProperties inside properties is a very classic schema error, unless you are really writing a JSON Schema meta schema, in which case the associated value would not be false. My guess is that the element was expected at the upper level where it actually means something, but maybe the entry just needs to be removed, I cannot decide simply.

What is really expected can probably be infered from the source code of the ansible commands which uses the described data structure.

The 2 other issues I reported in #4660 have a strange schema semantics which demonstrates that writing schemas is error prone, but I could not make an easy guess about what the schema writer had in mind.

If you can add at least one positive/negative tests, it would much easier to understand them and also to prevent further changes that might break the schema.

I am sorry, I was just planing to point out bugs in a schema, not to do debugging in an unfamiliar environment.

- Attempt at having a sane semantics on `GalaxyInfo` conditionals.
- Simply remove strange `additionalProperties` inside a `properties`.
@zx80
Copy link
Author

zx80 commented Jul 5, 2025

I've updated the GalaxyInfo structure to have a conditional with a clearer semantics and remove the strangeness.

Tox does not like it because it seems to actually check the strange then semantics which was to forbid all properties to appear together, whereas any subset was still okay (which is probably the non intentional part from the schema spec).

❓ what is the actual expectation when standalone is false? Is it to actually only forbid all props together, or to forbid any of these props to appear?

if not standalone, we interpret the previous schema as "these props are forbidden", which is not the same as "these props are forbidden when they are all together".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants