angular2-json-schema-form icon indicating copy to clipboard operation
angular2-json-schema-form copied to clipboard

Property with numbers in JSON schema does not get displayed in the html as labels

Open SureshNatarajan opened this issue 7 years ago • 4 comments

Issue type

I'm submitting a (check one): [X] Bug report [ ] Feature request [ ] Regression (something that used to work, but stopped working in a newer version) [ ] Support request [ ] Documentation issue or request

Prerequisites

Before posting, make sure you do the following (check all): [ ] Confirm you are using the latest versions of all necessary packages (or if not, explain why not) [ ] Search GitHub for a similar issue or PR [ ] If submitting a Support request, also search Stack Overflow for similar issues Note: Please cross-post GitHub support requests to Stack Overflow, and include a link in your GitHub issue to your Stack Overflow question. We do currently respond to support requests on GitHub, but we eventually expect to stop, and will then refer all support questions exclusively to Stack Overflow.

Current behavior

Sample JSON schema { "title": "Test", "properties": { "1": { "type": "string", "format": "uri" } } } https://angular2-json-schema-form.firebaseapp.com/

Expected behavior

Label "1" should be displayed in the converted html form

IMPORTANT: How can we reproduce your problem?

https://angular2-json-schema-form.firebaseapp.com/

Environment

OS name & version: Browser name & version: Angular version: Angular JSON Schema Form version(s): Other relevant software or packages:

Any other relevant information

SureshNatarajan avatar Apr 05 '18 05:04 SureshNatarajan

Have you considered this, perhaps?

{
    "schema": {
        "type": "object",
        "properties": {
            "1": {
                "type": "string",
                "format": "uri"
            }
        },
        "required": ["1"]
    },
    "data": {
        "1": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
    }
}

Works fine.

catull avatar Apr 05 '18 10:04 catull

Thanks for the suggestion @catull . Suggested one doesn't work. Label "1" is not displaying.

SureshNatarajan avatar Apr 06 '18 03:04 SureshNatarajan

Perhaps this does the trick ?

{
    "schema": {
        "type": "object",
        "properties": {
            "1": {
                "title": "Do you see the label now ? 1",
                "type": "string",
                "format": "uri"
            }
        },
        "required": ["1"]
    },
    "data": {
        "1": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
    }
}

catull avatar Apr 06 '18 09:04 catull

Thanks @catull. I think the workaround as of now is to add "title" with the numeric character. With this workaround I am able to see the label.

Example Schema: { "schema": { "type": "object", "properties": { "1": { "title": "1", "type": "string", "format": "uri" } } } }

SureshNatarajan avatar Apr 12 '18 11:04 SureshNatarajan