Repository navigation
docs: show the JSON request and response bodies on the resource pages - #77
Merged
Merged
Conversation
tools/generate-json-examples.php captures the request bodies from the SDK (docs/snippets/json/) and writes a "JSON on the wire" section into 31 resource pages, with the contract fixtures as response examples. composer docs:json:check runs in CI, so the examples follow the serialization. The docs workflow also rebuilds when the contract fixtures change.
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.
Billomat's API docs only show XML. The resource pages now have a JSON on the wire section (VitePress code group):
tools/generate-json-examples.phpcalls the SDK against a mock client and writes the captured body todocs/snippets/json/(23 examples: create calls of all main resources and sub-resources, settings update). They show exactly what the SDK sends: envelope, wire field names, money as strings, parent IDs.tests/Fixtures/Contractare imported with<<< @/../tests/...; empty lists are left out.json-examplesmarkers is generated (31 pages).composer docs:jsonwrites,composer docs:json:checkruns in the quality job and incomposer ci.tests/Fixtures/Contract/**changes.Gap: the sandbox has no offers, credit notes, letters, reminders, recurrings, incomings, articles or contacts, so those pages only show the request for now.
Test plan
composer docs:json:check, docs build (code groups render with the expected tabs), lint, PHPStan, Rector