Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

generate-typescript-typedefs sets type string for number field values #188

@m4w

Description

@m4w

Current behavior:
We use the generate-typescript-typedefs command to generate our types. But we noticed an issue: When we choose the field type 'number' in storyblok the generated type will be string, which is very unexpected, since this is a very easy type.

Expected behavior:
The type of a field-type number should be number as well.

Steps to reproduce:
Create a new Storyblok Block, with one field type number. Save that block.
Use the generate-typescript-typedefs command to generate the types for this new block. Notice that the new field-type has the type string instead of number.

An example components.json schema:

{
  "name": "some_block",
  "display_name": "Some Block",
  "schema": {
    "columns": {
      "type": "number",
      "pos": 0,
      "min_value": 2,
      "max_value": 3,
      "default_value": "2",
      "steps": 1
    }
  }
}

And the related typings:

export interface SomeBlockStoryblok {
  columns?: string
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions