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

Schema failures on message format 2 in iCU76 #381

Open
sven-oly opened this issue Jan 8, 2025 · 1 comment
Open

Schema failures on message format 2 in iCU76 #381

sven-oly opened this issue Jan 8, 2025 · 1 comment

Comments

@sven-oly
Copy link
Collaborator

sven-oly commented Jan 8, 2025

No description provided.

@sven-oly
Copy link
Collaborator Author

@mradbourne
I see this error message in icu76 generated test files for message_fmt2.

  File "/usr/local/google/home/ccornelius/ICU_conformance/conformance/testgen/generators/message_fmt2.py", line 54, in process_test_data
    logging.error("Problem validating JSON: %s agains schema",
Message: 'Problem validating JSON: %s agains schema'
Arguments: ('/usr/local/google/home/ccornelius/ICU_conformance/conformance/testgen/generators/../icu76/message_fmt2/message-format-wg-tests/functions/datetime.json', PosixPath('/usr/local/google/home/ccornelius/ICU_conformance/conformance/testgen/generators/../../schema/message_fmt2/testgen_schema.json'))
[2025-01-09 15:53:02,778] [ERROR]  Additional properties are not allowed ('$schema' was unexpected)
Failed validating 'additionalProperties' in schema:
    {'$comment': 'This allOf specifies required test properties that allow '
                 'a default. A value will be required in '3. 

                 "'defaultTestProperties' if one is not provided for every "
                 'individual test.',
     '$defs': {'anyExp': {'anyOf': [{'required': ['exp']},
                                    {'required': ['expParts']},
                                    {'required': ['expErrors']}]},
               'bidiIsolation': {'description': 'The bidi isolation '
...
     '$id': 'https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json',
     '$schema': 'https://json-schema.org/draft/2020-12/schema',
     'additionalProperties': False,
...
     'required': ['tests'],
     'title': 'MessageFormat 2 data-driven tests',
     'type': 'object'}
On instance:
    {'$schema': 'https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json',
     'defaultTestProperties': {'expErrors': False, 'locale': 'en-US'},
     'description': 'The built-in formatter for datetimes.',
     'scenario': 'Datetime function',
     'tests': [{'exp': '{:datetime}',3. 

                'expErrors': [{'type': 'bad-operand'}],
                'src': '{:datetime}'},3. 

...

This is one of the generated test files that includes "$schema" property, but the file testgen_schema.json doesn't allow that as a property. I think all of them are actually failing schema validation

Elango and I see two options:

  1. Allow additional properties
  2. In the list of properties, add "$schema".

There may be other options, but right now I think most or all of the mf2 validations are failing.

What do you think?

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

No branches or pull requests

1 participant