🇺🇦 Anna Filina on Nostr: If you build an API in PHP, try using zircote/swagger-php or equivalent. You will ...
If you build an API in PHP, try using zircote/swagger-php or equivalent. You will thank me later.
https://github.com/zircote/swagger-phpI used it last year when rescuing a project that derailed, in big part because of a lack of a verifiable contract between the UI and API teams.
I also like to automatically validate the schema on all requests and responses in automated acceptance tests. Then I don't have to write tests specifically for the input/output shape.
Published at
2023-08-18 15:18:35Event JSON
{
"id": "9f94139f667a92018e69f88e361b442a139d84bc0778aeb350429cc471d8f592",
"pubkey": "1b43d01197041621c7cbbaa8056c278b9abda73860436453c7af2eae97570807",
"created_at": 1692371915,
"kind": 1,
"tags": [
[
"proxy",
"https://phpc.social/users/afilina/statuses/110911285846376644",
"activitypub"
]
],
"content": "If you build an API in PHP, try using zircote/swagger-php or equivalent. You will thank me later.\nhttps://github.com/zircote/swagger-php\n\nI used it last year when rescuing a project that derailed, in big part because of a lack of a verifiable contract between the UI and API teams.\n\nI also like to automatically validate the schema on all requests and responses in automated acceptance tests. Then I don't have to write tests specifically for the input/output shape.",
"sig": "59489f697be9247036a04a9d590d90ce5d3e8388fcd3751e1fa3cbe904e05f049dde7c6b48f7becc372e8267c58b4db4baf5483165570581afaad630b2e55d2b"
}