docs: rewrite JsonRpcBundle docs, add SDK docs, move them under docs/api
en/docs/api/rest-bundle/developers/known_issues/open.md
new file +21
−0
Open issues
Known bugs and limitations of the current version of REST Bundle (1.3, not released yet; the latest release is 1.2.0): symptom, cause and workaround. Fixed ones are on the Fixed issues page.
<include>(.issues/core-validation-400.md)
<include>(.issues/enum-not-cast.md)
<include>(.issues/get-params-as-body.md)
<include>(.issues/single-http-method-in-docs.md)
<include>(.issues/docs-not-cached.md)
en/docs/api/rest-bundle/developers/known_issues/.issues/core-validation-400.md
new file +11
−0
Validation errors return 400, not 422
Affected versions: 1.0.0 — 1.3 (current).
Symptom. A #[RPC\Assertions] violation or a wrong parameter type gives 400 with RestBadRequestException, although the error table maps ConstraintsImposedException → 422.
Cause. The RPC core returns the error as an RPC error with code -32602; the REST layer recreates an RpcBadParamException from it, not a ConstraintsImposedException. Only a ConstraintsImposedException that reaches the REST layer directly gets 422.
Workaround. Expect 400 with per-parameter messages in detail-data.
en/docs/api/rest-bundle/developers/known_issues/.issues/enum-not-cast.md
new file +11
−0
Enum parameters are not converted from a string
Affected versions: 1.0.0 — 1.3 (current).
Symptom. GET /rest/items?status=active for a Status $status parameter (backed enum) returns 400 with a type error.
Cause. Query, path and form values are strings; RpcFromRest::castString() casts only scalar types, and the RPC core does not convert a string to an enum, equally for REST and JSON-RPC.
Workaround. Accept a string and convert the value in the method (Status::from($status)).
en/docs/api/rest-bundle/developers/known_issues/.issues/get-params-as-body.md
new file +11
−0
GET method parameters are documented as a request body
Affected versions: 1.0.0 — 1.3 (current).
Symptom. In OpenAPI a GET operation has a requestBody with the method parameters, and the Postman collection request has a raw JSON body. Client generators and Postman send the parameters in the body of a GET request instead of the query string.
Cause. OpenApiAdapter::buildParam() and PostmanAdapter::buildService() put all parameters except path variables into the body regardless of the HTTP method.
Workaround. The bundle accepts parameters from the query string (see Request parameters); for GET methods pass them in the query manually.
en/docs/api/rest-bundle/developers/known_issues/.issues/single-http-method-in-docs.md
new file +11
−0
Only the first HTTP method of a route is documented
Affected versions: 1.0.0 — 1.3 (current).
Symptom. A method with #[Route(..., methods: ['GET', 'POST'])] accepts both HTTP methods, but OpenAPI and Postman contain only the GET operation.
Cause. OpenApiAdapter::buildService() takes current($route->getMethods()), PostmanAdapter::buildService() takes $route->getMethods()[0]. Found in the code.
Workaround. Publish the method with a single HTTP method.
en/docs/api/rest-bundle/developers/known_issues/.issues/docs-not-cached.md
new file +11
−0
REST documentation is not cached
Affected versions: 1.0.0 — 1.3 (current).
Symptom. Every GET /rest, GET /rest/postman request builds the document again; there is no ETag and 304 Not Modified as in the RPC documentation.
Cause. RestEntryPointController::openapiAction() / postmanAction() call the adapter every time; JsonRpcBundle documentation caching works only for RPC routes.
Workaround. Cache the response at the HTTP cache or web server level, or do not expose the documentation in production.