Skip to content

Generate JSON Schema for PHP classes / objects #557

Open
@ddebowczyk

Description

I have an arbitrary PHP data class. I'd like to use Valinor to generate its representation as JSON Schema. It can be used as an input field for LLM (e.g. OpenAI or Anthropic) endpoint. LLM API responds with JSON following this JSON Schema. Then I can use Valinor deserializer to hydrate PHP object with the values from JSON, validate, etc.

See following example for code illustrating practical use case for such capability in Valinor:
https://docs.instructorphp.com/cookbook/examples/basics/complex_extraction

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions