GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - smithy-lang/smithy-php-core: Read Only sub-split: Schemas, shapes and documents for Smithy PHP.

BranchesTags
Open more actions menu

Latest commit

 

History

68 Commits
68 Commits

Folders and files

NameName
Last commit message
Last commit date
Checksum
Checksum
 
 
Endpoint
Endpoint
 
 
Exception
Exception
 
 
Model
Model
 
 
Retry
Retry
 
 
Serde
Serde
 
 
Shape
Shape
 
 
Transport
Transport
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

Smithy PHP Core

Runtime schemas, shape contracts, document values, and model conversion for Smithy PHP. Requires PHP 8.2 or later.

Installation

composer require smithy/core

Runtime Schemas

Schema supplies runtime metadata for a Smithy shape. It stores the shape ID, shape type, members, traits, target references, and generated target class.

use Smithy\Core\Serde\Schema;
use Smithy\Core\Shape\ShapeType;

$schema = new Schema(
    id: 'example.weather#City',
    type: ShapeType::String_,
);

Schema extensions attach cached metadata used by codecs, protocols, endpoint resolution, and pagination.

Documents

The document hierarchy represents every Smithy data-model type. Empty lists and empty maps remain distinct values.

use Smithy\Core\Shape\Document\AbstractDocument;

$document = AbstractDocument::fromValue('Raleigh');

echo $document->asString();

Runtime-loaded structures and unions use StructDocument and UnionDocument. Dynamic clients validate caller values against operation schemas before creating these documents.

Shape Contracts

Contract Responsibility
SerializableShapeInterface Dispatch a value to a serializer
SerializableStructInterface Expose structure schemas and members
UnionInterface Expose a union tag, member index, and value
EnumInterface Expose modeled enum values
OperationInterface Describe operation schemas and runtime metadata
ServiceInterface Describe a Smithy service

ShapeSerializerInterface and ShapeDeserializerInterface define the typed codec call surface.

Transport and Endpoint Contracts

Namespace Responsibility
Smithy\Core\Transport Transport, message exchange, and request/response contracts
Smithy\Core\Endpoint Resolved Endpoint and EndpointAuthScheme values

Protocols and transports depend on these contracts without depending on the client runtime. Endpoint resolvers live in Smithy\Client\Endpoint.

Sensitive Diagnostic Output

Generated structures and unions that can contain @sensitive data provide schema-aware diagnostic representations. String casts, print_r(), var_dump(), json_encode(), and PHP serialization redact sensitive members, including values nested in collections and unions. Redacted PHP serialization cannot be restored into a modeled value.

var_export(), reflection, and direct property inspection bypass these hooks and can expose public sensitive members. Do not pass modeled objects containing sensitive data to those APIs or to logging systems that inspect properties directly.

Runtime Models

SmithyModel loads a Smithy JSON AST. SchemaConverter turns model shapes into runtime schemas. TypeRegistry resolves runtime shapes and errors from those schemas. SmithyModel::fromFile() accepts only local regular files; use SmithyModel::fromJson() for model contents supplied directly by callers. PHP stream-wrapper URIs are not accepted as model file paths.

Numeric Types

BigInteger and BigDecimal preserve values outside native PHP integer and floating-point ranges. Codecs emit their validated numeric strings according to the target wire format.

Dependencies

This package depends only on PHP.

Design

See Core Runtime Design.

Contributing

Run the component tests from the monorepo root:

vendor/bin/phpunit tests/Core

About

Read Only sub-split: Schemas, shapes and documents for Smithy PHP.

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.