API Models Metadata - evansims/openfga-php GitHub Wiki
Contains metadata information about type definitions in your authorization model. Metadata provides additional context about how your authorization types behave, including module information, relation constraints, and source details. This information helps with model validation, debugging, and understanding the structure of your authorization system. Use this when you need insights into the properties and constraints of your authorization model's type definitions.
Table of Contents
OpenFGA\Models
MetadataInterface
JsonSerializable
ModelInterface
- MetadataInterface (interface)
Name | Value | Description |
---|---|---|
OPENAPI_MODEL |
Metadata |
public function getModule(): ?string
Get the module name for this metadata. Modules provide a way to organize and namespace authorization model components, similar to packages in programming languages. This helps with model organization and prevents naming conflicts in large authorization systems.
string
| null
— The module name, or null if not specified
public function getRelations(): ?OpenFGA\Models\Collections\RelationMetadataCollection
Get the collection of relation metadata. Relation metadata provides additional configuration and context for specific relations within a type definition. This can include documentation, constraints, or other relation-specific settings that enhance the authorization model.
RelationMetadataCollection
| null
— The relation metadata collection, or null if not specified
public function getSourceInfo(): ?OpenFGA\Models\SourceInfoInterface
Get the source code information for this metadata. Source information provides debugging and development context by tracking where authorization model elements were defined. This is particularly useful for development tools and error reporting.
SourceInfoInterface
| null
— The source information, or null if not available
public function jsonSerialize(): array
array
Implements Models\MetadataInterface
public function schema(): SchemaInterface
Get the schema definition for this model. This method returns the schema that defines the structure, validation rules, and serialization behavior for this model class. The schema is used for data validation, transformation, and ensuring consistency across API operations with the OpenFGA service. Each model's schema defines: - Required and optional properties - Data types and format constraints - Nested object relationships - Validation rules and business logic constraints The schema system enables the SDK to automatically validate incoming data, transform between different representations, and ensure compliance with the OpenFGA API specification.
SchemaInterface
— The schema definition containing validation rules and property specifications for this model