64#ifndef A11_ACTIONS_DESCRIBE_H_
65#define A11_ACTIONS_DESCRIBE_H_
71#include <absl/status/statusor.h>
72#include <nlohmann/json_fwd.hpp>
168absl::StatusOr<ActionSchema>
SchemaFromJson(
const nlohmann::json& entry);
180 const nlohmann::json& document);
Schemas describing an action's typed interface and its settings.
A thread-safe catalogue mapping action names to schema and handler.
Definition registry.h:59
absl::StatusOr< std::vector< nlohmann::json > > SchemasInDocument(const nlohmann::json &envelope)
The actions entries of document, or why there are none to read.
Definition describe.cc:497
PortView
Which ports a written schema includes.
Definition describe.h:92
@ kAll
Everything the schema declares, autofills flagged.
@ kCallable
What a caller may write. The default.
nlohmann::json RegistryToJson(const ActionRegistry ®istry, const SchemaQuery &request)
A whole document: every schema in registry that query accepts.
Definition describe.cc:387
absl::StatusOr< std::string > RegistryToJsonText(const ActionRegistry ®istry, const SchemaQuery &request)
RegistryToJson as text, or why it could not be encoded.
Definition describe.cc:412
constexpr std::string_view kSchemaDocumentFormat
The format field of the schema document.
Definition describe.h:81
nlohmann::json SchemaToJson(const ActionSchema &schema, bool runnable, PortView ports)
One schema as an actions entry.
Definition describe.cc:336
absl::StatusOr< SchemaQuery > ParseSchemaQuery(std::string_view encoded)
Parses a SchemaQuery from the request port's JSON.
Definition describe.cc:265
absl::StatusOr< ActionSchema > SchemaFromJson(const nlohmann::json &entry)
The schema an actions entry was written from.
Definition describe.cc:427
bool SchemaQueryAccepts(const SchemaQuery &request, std::string_view name)
Whether name matches query's name filters.
Definition describe.cc:250
absl::StatusOr< ActionSchema > SchemaFromJsonText(std::string_view encoded)
SchemaFromJson, parsing encoded first.
Definition describe.cc:491
absl::StatusOr< std::string > SchemaToJsonText(const ActionSchema &schema, bool runnable, PortView ports)
One schema as a whole document, for a route that answers with one.
Definition describe.cc:417
absl::StatusOr< SchemaQuery > ParseSchemaQueryString(std::string_view query)
Parses a SchemaQuery from a URL query string.
Definition describe.cc:303
The full typed interface of an action.
Definition schema.h:138
Which schemas to write, and how much of each.
Definition describe.h:103
std::vector< std::string > exact
Exact names, in addition to names; empty adds nothing.
Definition describe.h:107
std::vector< std::string > names
Full-match name patterns; empty matches every name.
Definition describe.h:105
bool runnable_only
Omit actions registered for their schema alone, which live on a peer.
Definition describe.h:112
PortView ports
Definition describe.h:108
bool include_reserved
Include the __-prefixed reserved actions, discovery's own included.
Definition describe.h:110