Fixed issues

← Fixed issues

Ashterix

docs: rewrite JsonRpcBundle docs, add SDK docs, move them under docs/api

en/docs/api/rest-bundle/developers/known_issues/fixed.md new file +33 āˆ’0

1 + # Fixed issues
2 +
3 + Bugs from previous versions and the version in which they were fixed. If you are on an affected version, upgrade or use the workaround. Open issues are on the [Open issues](/docs/api/rest-bundle/developers/known_issues/open) page.
4 +
5 + <include>(.issues/post-response-not-fired.md)
6 +
7 + ---
8 +
9 + <include>(.issues/path-query-not-cast.md)
10 +
11 + ---
12 +
13 + <include>(.issues/error-mapping-order.md)
14 +
15 + ---
16 +
17 + <include>(.issues/application-error-status.md)
18 +
19 + ---
20 +
21 + <include>(.issues/rest-application-exception.md)
22 +
23 + ---
24 +
25 + <include>(.issues/postman-adapter-request-stack.md)
26 +
27 + ---
28 +
29 + <include>(.issues/malformed-json-ignored.md)
30 +
31 + ---
32 +
33 + <include>(.issues/wrong-method-404.md)

en/docs/api/rest-bundle/developers/known_issues/.issues/post-response-not-fired.md new file +10 āˆ’0

1 + ### REST calls did not fire `rpc.post_response`
2 +
3 + :::success subtitle="Fixed in 1.3 (not released yet)"
4 + Affected versions: 1.0.0 — 1.2.0.
5 + According to the 1.3 release notes.
6 + :::
7 +
8 + **Symptom.** After a REST call `rpc.post_response` listeners did not run: `#[RPC\CacheRelation]` invalidation, async and post-response listeners of the application.
9 +
10 + **Fix.** The controller executes the request through the JsonRpcBundle 10.4.2 `RpcExecutor`; a successful call gets `rpc.post_response` on `kernel.terminate`.

en/docs/api/rest-bundle/developers/known_issues/.issues/path-query-not-cast.md new file +9 āˆ’0

1 + ### Path and query values did not fit typed parameters
2 +
3 + :::success subtitle="Fixed in 1.3 (not released yet)"
4 + Affected versions: 1.0.0 — 1.2.0.
5 + :::
6 +
7 + **Symptom.** `GET /rest/catalog/items/42` for `item(int $id)` returned `400` with `must be of type int, string given`.
8 +
9 + **Fix.** `RpcFromRest` casts strings from the path, query and form to the declared scalar type of the parameter; see [Request parameters](/docs/api/rest-bundle/requests).

en/docs/api/rest-bundle/developers/known_issues/.issues/error-mapping-order.md new file +11 āˆ’0

1 + ### Unknown method and constraint errors returned 400
2 +
3 + :::success subtitle="Fixed in 1.3 (not released yet)"
4 + Affected versions: 1.0.0 — 1.2.0.
5 + :::
6 +
7 + **Symptom.** `RpcMethodNotFoundExceptionRpc` and `ConstraintsImposedException` were returned as `400` instead of `404` and `422`.
8 +
9 + **Cause.** Both classes are subclasses of `RpcBadRequestException`, which came before them in `RestErrorNormalizer::ERROR_MAPPING`; in addition, `RestValidationException` did not implement `RestErrorInterface` and could not be created without an array of constraints.
10 +
11 + **Fix.** Subclasses are checked before their parent classes; `RestValidationException` implements `RestErrorInterface` and takes the constraints from the previous exception.

en/docs/api/rest-bundle/developers/known_issues/.issues/application-error-status.md new file +11 āˆ’0

1 + ### The HTTP code of an application error was ignored
2 +
3 + :::success subtitle="Fixed in 1.3 (not released yet)"
4 + Affected versions: 1.0.0 — 1.2.0.
5 + :::
6 +
7 + **Symptom.** `throw new CustomApplicationException('Order is closed', 409)` from a method returned `400`.
8 +
9 + **Cause.** `RestErrorNormalizer` created the REST exception with code `0` for the classes from the table, and for the rest checked the code with `in_array()` against the status texts, so the check never matched.
10 +
11 + **Fix.** The HTTP error code of the exception is kept; see [Error handling](/docs/api/rest-bundle/error_handling).

en/docs/api/rest-bundle/developers/known_issues/.issues/rest-application-exception.md new file +11 āˆ’0

1 + ### `RestApplicationException` did not load
2 +
3 + :::success subtitle="Fixed in 1.3 (not released yet)"
4 + Affected versions: 1.0.0 — 1.2.0.
5 + :::
6 +
7 + **Symptom.** A fatal error when using `RestApplicationException` or converting an application error.
8 +
9 + **Cause.** The class extended `Ufo\RpcError\RpcCustomApplicationException`, which does not exist in `ufo-tech/rpc-exceptions` 2.x.
10 +
11 + **Fix.** The class extends `Ufo\RpcError\CustomApplicationException`; the constructor arguments are optional.

en/docs/api/rest-bundle/developers/known_issues/.issues/postman-adapter-request-stack.md new file +12 āˆ’0

1 + ### The Postman collection failed with JsonRpcBundle 10.3+
2 +
3 + :::success subtitle="Fixed in 1.3 (not released yet)"
4 + Affected versions: 1.2.0.
5 + According to the 1.3 release notes.
6 + :::
7 +
8 + **Symptom.** `GET /rest/postman` ended with a fatal error with JsonRpcBundle 10.3 and later.
9 +
10 + **Cause.** `PostmanAdapter` redeclared the `$requestStack` property, which the base `AbstractPostmanAdapter` received in 10.3.
11 +
12 + **Fix.** `RequestStack` is passed to the base adapter constructor.

en/docs/api/rest-bundle/developers/known_issues/.issues/malformed-json-ignored.md new file +9 āˆ’0

1 + ### An invalid JSON body was ignored
2 +
3 + :::success subtitle="Fixed in 1.1.0"
4 + Affected versions: 1.0.0.
5 + :::
6 +
7 + **Symptom.** The method was executed without body parameters if the body was not valid JSON.
8 +
9 + **Fix.** An invalid or scalar JSON body returns `400`.

en/docs/api/rest-bundle/developers/known_issues/.issues/wrong-method-404.md new file +9 āˆ’0

1 + ### A wrong HTTP method returned 404
2 +
3 + :::success subtitle="Fixed in 1.1.0"
4 + Affected versions: 1.0.0.
5 + :::
6 +
7 + **Symptom.** A request to an existing path with an HTTP method missing from `#[Route]` returned `404`.
8 +
9 + **Fix.** Each REST route gets a `<name>_method_not_allowed` fallback route, and such a request returns `405`.