Skip to content

Schemas that have a name with a '-' character in them cause invalid code to be generated #83

Closed
@wxyangf

Description

@wxyangf

eg:

"Schema-Name": {
  "id": {
         "type": "integer",
          "title": "Id"
    }
   ...
}

Will generate code that looks like this:

export const $Schema-Name= {
    properties: {
        id: {
            type: 'integer',
            title: 'Id'
        }
        ...
     }

Dashes are not valid characters for javascript variable names, but are valid strings for json keys.

Not sure the best way to deal with this, maybe export an object instead, mangle to a _ or just explicitly not support having - in schema names and add a test for that.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions