Skip to content

UndefVarError: schema not defined in JSONSchema #78

Open

Description

@dj-passey

Hey, I can't seem to find the JSONSchema.schema function, even if I try installing 1.2.x - 1.5.x

I reproduced it in a Google Colab here.

Let me know. I'd like to be able to generate schemas for my custom structs.

DJ

Activity

  1. damourChris commented on Feb 22, 2026

    @damourChris

    Seems like the "generation.jl" file is not in the registered package?

    checking .julia/packages/JSONSchema shows only "JSONSchema.jl schema.jl validation.jl"

    Installing the package via git solves this though.

  2. odow commented on Feb 22, 2026

    @odow
    Collaborator

    The master branch currently contains a breaking and unreleased v2.0.

    For the latest released version, see https://github.com/JuliaIO/JSONSchema.jl/tree/v1.5.0

  3. quinnj commented on Oct 4, 2026

    @quinnj
    Member

    Schema generation was added in #80. Current master identifies itself as version 1.6.0, and this example passes on unchanged commit 10199bc0eab591bf9916131b9de2d18f4775d2da with Julia 1.13.1:

    using JSONSchema
    
    struct Parameters
        count::Int
        label::String
    end
    
    s = JSONSchema.schema(Parameters)
    JSONSchema.validate(s, Dict("count" => 1, "label" => "ok")) # nothing

    The General registry still ends at version 1.5.0, so the reported error remains valid for the latest registered package. Installing the development branch provides the generator; a registered version containing it is still needed before closing this issue as fixed for ordinary package installation.

    AI disclosure: This work was prepared with assistance from OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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