Open
Conversation
Raven is really cool. It that might happen that, when an api evolves, some deprecated infos remain in its response. What is really top on XML is the XSD, which checks the structure of the data. Json des not have something like XSD. From openApi we can extract a structure definition. Why not using it to check an api response object's structure? This is basically the goal of those changes, allowing the reference structure tree to be used externally. It could be further used to check json response structure conformity. Not talking about values here, but properties being present or not, tested or ignored.
shulard
reviewed
Dec 10, 2024
Member
shulard
left a comment
There was a problem hiding this comment.
Thank you for the proposal (and sorry for the delay 😞), if we go this way, I suggest having a specific object to extract the structure based on the schema. This structure must be represented as an object. Let's discuss my little comment about the PathFinder then we can move forward!
| * One usage can be to further process the resulting array | ||
| * in order to check an api json response object's structure conformity | ||
| */ | ||
| public function getReferenceStructure(string $method, string $uri, int $statusCode, ?string $contentType): ?array |
Member
There was a problem hiding this comment.
Isn't that method recreating the League\OpenAPIValidation\PSR7\PathFinder logic ? This object is able to retrieve (based on method and uri) a list of available operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raven is really cool.
It that might happen that, when an api evolves, some deprecated infos remain in its response. What is really top on XML is the XSD, which checks the structure of the data. Json des not have something like XSD. From openApi we can extract a structure definition. Why not using it to check an api response object's structure? This is basically the goal of those changes, allowing the reference structure tree to be used externally. It could be further used to check json response structure conformity. Not talking about values here, but properties being present or not, tested or ignored.