Supress warnings and fix broken links (#4409)

This commit is contained in:
Mahati Chamarthy 2022-10-27 09:53:59 +01:00 коммит произвёл GitHub
Родитель f1e122ef87
Коммит e09cb5656e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -72,11 +72,11 @@ Each function is installed as the handler for a specific HTTP resource, defined
:end-before: SNIPPET_END: install_record
:dedent:
This example installs at ``"log/private", HTTP_POST``, so will be invoked for HTTP requests beginning :http:POST:`/log/private`.
This example installs at ``"/app/log/private", HTTP_POST``, so will be invoked for HTTP requests beginning :http:POST:`/app/log/private`.
The return value from ``make_endpoint`` is an ``Endpoint&`` object which can be used to alter how the handler is executed. For example, the handler for :http:POST:`/log/private` shown above sets a `schema` declaring the types of its request and response bodies. These will be used in calls to the :http:GET:`/api` endpoint to populate the relevant parts of the OpenAPI document. That OpenAPI document in turn is used to generate the entries in this documentation describing :http:POST:`/log/private`.
The return value from ``make_endpoint`` is an ``Endpoint&`` object which can be used to alter how the handler is executed. For example, the handler for :http:POST:`/app/log/private` shown above sets a `schema` declaring the types of its request and response bodies. These will be used in calls to the :http:GET:`/app/api` endpoint to populate the relevant parts of the OpenAPI document. That OpenAPI document in turn is used to generate the entries in this documentation describing :http:POST:`/app/log/private`.
There are other endpoints installed for the URI path ``/log/private`` with different verbs, to handle :http:GET:`GET </log/private>` and :http:DELETE:`DELETE </log/private>` requests. Requests with those verbs will be executed by the appropriate handler. Any other verbs, without an installed endpoint, will not be accepted - the framework will return a ``405 Method Not Allowed`` response.
There are other endpoints installed for the URI path ``/app/log/private`` with different verbs, to handle :http:GET:`GET </app/log/private>` and :http:DELETE:`DELETE </app/log/private>` requests. Requests with those verbs will be executed by the appropriate handler. Any other verbs, without an installed endpoint, will not be accepted - the framework will return a ``405 Method Not Allowed`` response.
To process the raw body directly, a handler should use the general lambda signature which takes a single ``EndpointContext&`` parameter. Examples of this are also included in the logging sample app. For instance the ``log_record_text`` handler takes a raw string as the request body:
@ -163,7 +163,7 @@ The final piece is the definition of the endpoint itself, which uses an instance
Default Endpoints
~~~~~~~~~~~~~~~~~
The logging app sample exposes several built-in endpoints which are provided by the framework for convenience, such as :http:GET:`/tx`, :http:GET:`/commit`, and :http:GET:`/receipt`. It is also possible to write an app which does not expose these endpoints, either to build a minimal user-facing API or to re-wrap this common functionality in your own format or authentication. A sample of this is provided in ``samples/apps/nobuiltins``. Whereas the logging app declares a registry inheriting from :cpp:class:`ccf::CommonEndpointRegistry`, this app inherits from :cpp:class:`ccf::BaseEndpointRegistry` which does not install any default endpoints:
The logging app sample exposes several built-in endpoints which are provided by the framework for convenience, such as :http:GET:`/app/tx`, :http:GET:`/app/commit`, and :http:GET:`/app/receipt`. It is also possible to write an app which does not expose these endpoints, either to build a minimal user-facing API or to re-wrap this common functionality in your own format or authentication. A sample of this is provided in ``samples/apps/nobuiltins``. Whereas the logging app declares a registry inheriting from :cpp:class:`ccf::CommonEndpointRegistry`, this app inherits from :cpp:class:`ccf::BaseEndpointRegistry` which does not install any default endpoints:
.. literalinclude:: ../../samples/apps/nobuiltins/nobuiltins.cpp
:language: cpp

Просмотреть файл

@ -2,7 +2,7 @@ RPC API
=======
Application RPCs are exposed under ``/app`` and require authentication with a valid user identity.
You can read what application endpoints may look like, as generated by the :doc:`:example C++ logging app <build_apps/example_cpp>`, in :doc:`/build_apps/example_rpc_api`.
You can read what application endpoints may look like, as generated by the :doc:`example C++ logging app </build_apps/example_cpp>`, in :doc:`/build_apps/example_rpc_api`.
Built-ins
----------