Skip to content

lower(m::Module) throws in v0.21 #415

Closed

Description

@hhaensel

In GenieFramework we rely on rendering a Module as its String value, which JSON v1 perfectly does. However, v0.21 does throw an error.

In this transition period from JSON3 to JSON we still support JSON 0.21, but we cannot lower Modules as String, because its lowering is hard-coded in Writer.jl

I propose a small patch to allow for specialization of lower(m::Module) without breaking existing behaviour.

lower(m::Module) = throw(ArgumentError("cannot serialize Module $m as JSON"))

to

abstract type DummyModule end
# chose a Union type to make it possible to extend lower for Modules
lower(m::Union{Module,DummyModule}) = throw(ArgumentError("cannot serialize Module $m as JSON"))

Activity

  1. changed the title [-]lower(m::Module) throws in v 0.21[/-] [+]lower(m::Module) throws in v0.21[/+] on Dec 3, 2025
  2. quinnj commented on Jan 14, 2026

    @quinnj
    Member

    JSON 0.21 is no longer actively maintained - development focus has moved to v1.x where Module lowering works correctly. PRs for backwards-compatible fixes to 0.21 will be considered, but we recommend upgrading to v1.

  3. hhaensel commented on Jan 27, 2026

    @hhaensel
    ContributorAuthor

    We already support JSON v1, it's meant for people who cannot yet upgrade to the latest JSON because they have other dependencies. But if it is urgent, people could leave a message here.

  4. quinnj commented on Oct 16, 2026

    @quinnj
    Member

    Thanks for the report. This works in JSON 1.x (JSON.json(Main) == "\"Main\""), and 0.21 is not getting further releases, so I am closing this.

    [comment generated via AI]

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