-
-
Notifications
You must be signed in to change notification settings - Fork 582
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
Cannot validate Redfish schemas from last redfish spec #610
Comments
Hi, hard to answer this without a reproducible example (your schema at least). That traceback is telling you it hit some URL and got back something that wasn't JSON, but beyond that impossible to tell without whatever you're running there (the schema). |
Hi Julian, I investigate a lot. Well, I have a proxy, i guess it could be the origin of this issue. There is an exception just after the breakpoint with HttpError 403 Forbidden (See attachement in the Visual Code terminal on the bottom when I use a terminal) The url is accessible from a browser on the same machine. Any idea ? I guess I will change geturl to request library. Regards, |
I don't see the relationship there between what you're breaking on -- the traceback is saying the URL it hit is returning a 403. Why it is returning a 403, or what URL is being hit and why (probably because you have a $ref in your schema?) is the question -- but, and apologies for this, the issue tracker isn't really the place for these sorts of things. It's for bug reports or feature requests -- if you need some help debugging there are other channels where that help is more than welcome, though you still will likely need to provide the reproducible example for others to help. https://sscce.org is a good site if you want some guidelines on what that looks like. And the JSON Schema slack channel is probably your first bet on where specifically I think. |
Are you sure that no header is being sent at all? I haven't looked in awhile, but very likely one is being sent, but the site you're talking to rejects scripting user agents. Changing it in the way you have likely evades their "ban" on scripting user agents since you effectively now have a user agent it doesn't know about or assumes might be a browser, but that's not something that It's true that But yeah if you do find that no user agent header is being set at all that certainly should be fixed. |
Are you sure that no header is being sent at all? I don't know why Redfish / DMTF site cares about it. Thank you for your help and your reactivity, |
with a running webserver on 8080, and with requests installed, sends a user agent of: Without requests (via urllib2), it sends:
What are you seeing that tells you no User-Agent is being sent? |
78c888273 Merge pull request #618 from json-schema-org/gregsdennis/contentschema-should-fail-content 5cbc53bc0 Merge pull request #613 from santhosh-tekuri/rjp-multidigit bb000ce98 Merge pull request #620 from json-schema-org/ether/remove-unused-remotes c4c490f1d Merge pull request #617 from json-schema-org/gregsdennis/dynamicAnchor-inside-propertyDependencies 0189831a9 remove schemas that are never referenced cf1b94249 Merge pull request #610 from handrews/rm-remotes d6490e817 move anchors into defs 2f9d117c0 Merge pull request #616 from json-schema-org/gregsdennis/propertyDependencies-and-unevaluated 4e5649cd0 move tests to draft-next a41f2f6c4 added type:object to contentSchema schemas 2f50e7864 add tests for $dynamicAnchor in multiple branches of propertyDependencies 4794a1991 add tests for unevaluatedProperties seeing inside propertyDependencies 27cc299f3 Add RJP test 'multi-digit integer prefix' 716b95d94 Merge pull request #612 from santhosh-tekuri/rjp-positive 320c804d1 Add RJP test 'explicit positive prefix' c8f210c39 Merge pull request #611 from santhosh-tekuri/time-alpha 3faeb222d add time test 'contains letters' 642441f2d Merge pull request #603 from santhosh-tekuri/uuid-nonstr 94d5043c7 add non-string uri tests 0c81374a2 Remove unneeded remotes 97a3e2156 Merge pull request #608 from json-schema-org/json-everything-uses-the-test-suite bdaf7e8be added json-everything to 'who uses' section of readme; removed manatee.json (deprecated) f00ec1008 Merge pull request #606 from santhosh-tekuri/duration-nounit 134480721 Merge pull request #607 from santhosh-tekuri/time-offsetprefix dd4538eee Test time format 'offset not starting with plus or minus' 80fe2db15 test duration format 'element without unit' 38ea15116 Merge pull request #604 from santhosh-tekuri/time-offset 613ec170e second fraction, not offset ee4bd4eb6 Add time format test with second fraction, no offset 86c2517cd Merge pull request #605 from santhosh-tekuri/rjp-empty cfe80006a Add relative-json-pointer test with empty string 31796b3b8 add non-string uuid tests git-subtree-dir: json git-subtree-split: 78c8882732bcdc2dad81cd7ce1e3f9bca6fb7a9d
Hi,
I cannot validate my simple Chassis schema with jsonschema.
I downloaded last redfish schemas DSP8010.
I tried to validate with :
mychassis.json
{
"@odata.type": "#Chassis.v1_7_0.Chassis",
"Id": "Rack_1",
"Name": "Sequana2 Rack",
"ChassisType": "Rack",
"Model": "Sequana 2 Ancien Rack",
"WeightKg": 123,
"WidthMm": 654,
"Manufacturer": "Bull",
"SerialNumber": "3M220100SL",
"PartNumber": "",
"PowerState": "On",
"@odata.context": "/redfish/v1/$metadata#Chassis.Chassis",
"@odata.id": "/redfish/v1/Chassis/Rack_1",
"@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright."
}
Error:
File "/bin/jsonschema", line 11, in <module> sys.exit(main()) File "/usr/lib/python2.7/site-packages/jsonschema/cli.py", line 73, in main sys.exit(run(arguments=parse_args(args=args))) File "/usr/lib/python2.7/site-packages/jsonschema/cli.py", line 84, in run for error in validator.iter_errors(instance): File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 323, in iter_errors for error in errors: File "/usr/lib/python2.7/site-packages/jsonschema/_validators.py", line 263, in ref for error in validator.descend(instance, resolved): File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 339, in descend for error in self.iter_errors(instance, schema): File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 323, in iter_errors for error in errors: File "/usr/lib/python2.7/site-packages/jsonschema/_validators.py", line 286, in properties schema_path=property, File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 339, in descend for error in self.iter_errors(instance, schema): File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 323, in iter_errors for error in errors: File "/usr/lib/python2.7/site-packages/jsonschema/_validators.py", line 259, in ref scope, resolved = validator.resolver.resolve(ref) File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 734, in resolve return url, self._remote_cache(url) File "/usr/lib/python2.7/site-packages/functools32/functools32.py", line 400, in wrapper result = user_function(*args, **kwds) File "/usr/lib/python2.7/site-packages/jsonschema/validators.py", line 744, in resolve_from_url raise exceptions.RefResolutionError(exc) jsonschema.exceptions.RefResolutionError: No JSON object could be decoded
Any suggestion?
Best Regards,
Francine
The text was updated successfully, but these errors were encountered: