Open fireproofsocks opened 7 years ago
Hey @fireproofsocks , this sounds really (!) really handy.. How is the progress of this feature? Thanks a lot and all the best
It's a tricky feature because the package has attempted to simplify the representation of the definitions so that JSON or PHP can be interchangeable, but in reality it's hard to maintain that simplification. My last attempt at implementing this did not go so well...
Hey there, thanks a lot for the fast reply on this.. Wouldn't it be possible to just "recursive replace" the filepaths with the respective content in order to achieve the latter? All the best
When using the
$ref
keyword and pointing to a.json
file (e.g. a local file path), we should be able to specify relative file paths in a couple "expected" places.E.g. in a PersonDto:
Or inside
person.json
:In the first case, the
$ref
should resolve relative to the location of thePersonDto.php
class. In the second, the../partials/phone.json
should resolve relative to the location of theperson.json
file.Probably the code should be refactored to use the
league/json-reference
package.