online-judge-tools / api-client

API client to develop tools for competitive programming
MIT License
62 stars 18 forks source link

Failed to get-problem with compatibility flag on due to schema error #149

Closed jxai closed 1 year ago

jxai commented 2 years ago

Summary / 概要

get-problem --compatibility failed due to schema error, can be reproduced with with any service.

Steps to reproduce / 再現方法

environments: Ubuntu 20.04, Python 3.8.12

Expected behavior / 期待される挙動

Getting a problem JSON

Actual behavior / 実際の挙動

Failed due to schema eror.

$ oj-api get-problem --compatibility http://jag2013spring.contest.atcoder.jp/tasks/icpc2013spring_a

Got following ERROR:

Traceback (most recent call last):                                                                     
  File "/opt/miniconda3/bin/oj-api", line 8, in <module>                                               
    sys.exit(main())                                                                                   
  File "/opt/miniconda3/lib/python3.8/site-packages/onlinejudge_api/main.py", line 356, in main
    jsonschema.validate(result, schema)                                                                
  File "/opt/miniconda3/lib/python3.8/site-packages/jsonschema/validators.py", line 1018, in validate  
    cls.check_schema(schema)                                                                           
  File "/opt/miniconda3/lib/python3.8/site-packages/jsonschema/validators.py", line 190, in check_schema
    raise exceptions.SchemaError.create_from(error)                                                    
jsonschema.exceptions.SchemaError: [{'type': 'object', 'properties': {'input': {'type': 'string'}, 'output': {'type': 'string'}}, 'required': ['input', 'output'], 'additionalProperties': False}] is not of typ
e 'object', 'boolean'                                                                                  

Failed validating 'type' in metaschema['allOf'][1]['properties']['properties']['additionalProperties']['$dynamicRef']['allOf'][1]['properties']['items']['$dynamicRef']['allOf'][0]:

Other notes / その他

koba-e964 commented 1 year ago

Thank you for reporting! This issue was reproduced and confirmed to happen for several problems.

koba-e964 commented 1 year ago

This bug was fixed. Thank you! I completely overlooked https://github.com/online-judge-tools/api-client/pull/150. Sorry.