Comments (7)
Hello. I'm guessing that you're using $ref
to resolve json-calendar.schema
is that correct? The support for $ref
is currently limited. I have been working on expanding the implementation of $ref
and URI resolving to add support for more use cases. I hope to issue a pull request soon.
from json-schema.
I don't know what $ref
is, but is there an alternative wihch i can use?
from json-schema.
what is combineRelativePathWithBasePath
trying to achieve?
from json-schema.
Using $ref
allows you to refer to schemas in other locations, whether they be within the current schema file or in some other file. My guess is that you have something like {"$ref": "json-calendar.schema"}
somewhere in your schema and json-schema can't resolve the reference to that file.
The combineRelativePathWithBasePath
tries to merge a base path with a relative path. For example, suppose your base path is /foo/bar/ick
and your relative path is ../json-calendar.schema
. Then the method should combine these into /foo/bar/json-calendar.schema
(notice that ick
is removed from the path).
from json-schema.
Oh, now i understand what you meant by $ref
. But i haven't such references in there.
The error is within FileGetContents which throws an exception at line 34, so the schema couldn't be read.
btw. it only threw this exception after i copied "ResourceNotFoundException.php" inside "Uri/Retrievers/" otherwise i got "PHP Fatal error: Class 'JsonSchema\Uri\Retrievers\ResourceNotFoundException' not found in ...", quick and dirty, i know.
After "fixing" this, i could go on debugging. i added "error_log($uri);" in line 31 in FileGetContents.php, and it gave me ":///is/htdocs/wp10606769_ZYB0S33ES7/JSON_Feed/inc/schemata/json-calendar.json" which is why the schema couldn't be found.
(should have been "/is/htdocs/wp10606769_ZYB0S33ES7/JSON_Feed/inc/schemata/json-calendar.json")
so i tried to correct the path:
if(preg_match('/^:\/\/\//', $uri)) { $uri = str_replace(':///', '/', $uri); }
but then something really weired happened.
my autoloader tried to load a class qjesqzok_k_
(Class: "qjesqzok_k_" not found (inc/qjesqzok_k_.php)) and certainly failed to do so, because there i no such class/php file there.
here's what i use as an autoloader:
pl_autoload_register(function ($class) { $file = 'inc/'.strtr($class, '\\', '/').'.php'; if (file_exists($file)) { require $file; return true; } else { echo '#argl#' .'<br>'; echo 'Class: "' .$class . '" not found (' .$file .')'; exit; } });
now i'm stuck.
i know this all sounds weired, but have you ever tried to run your class on different machines (linux for example) or am i simply too stupid to use this?
from json-schema.
Ah, nevermind, this has sth. to do with WordPress and the way i'm using it right now.
but besides that, you might have a look at the file/path quirks i had.
and thanks for helping out :-)
from json-schema.
@michapixel, any chances that you resolved this issue and you remember the answer? ;) Two years later I have the same problem as you had (I'm not using WP but Cake PHP).
from json-schema.
Related Issues (20)
- Show line numbers HOT 4
- Schema validation always returns true HOT 2
- Validation always returning true HOT 4
- oneOf, and anyOf annotation example HOT 4
- URI schemas incorrectly validated with FILTER_VALIDATE_URL HOT 7
- JsonSchema\Exception\InvalidArgumentException HOT 2
- JsonSchema\Exception\InvalidArgumentException | is an invalid type for string|null HOT 5
- HTTP to HTTPS redirection breaks remote reference resolution HOT 3
- not validating nested array with Symfony phpunit, or prop names HOT 3
- Possibly enum check is O(n) maybe can be O(1) for more performance HOT 4
- Why do we support higher version json-schema? HOT 3
- Inconsistent behavior with allOf/oneOf between master branch and latest release (v5.2.13) HOT 6
- Version number format changed in 5.2.13 HOT 2
- Mixing properties and patternProperties fails for properties not matching the patternProperties definition HOT 4
- Latest version named `v5.2.13` introduced issues in other soft that use versionning comparaison HOT 7
- bug: anyOf / oneOf with objects and default values HOT 5
- bug: type order in 'allOf' has an impact HOT 3
- Fatal error: Uncaught Error: Class 'Opis\Uri\Uri' not found HOT 2
- Triage on Issues & Pull requests HOT 1
- Type coercion not working properly in 5.2.13 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-schema.