Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ref can't be saved in firebase as a key because it contains '$' #5

Closed
othermark opened this issue Nov 28, 2017 · 3 comments
Closed

Comments

@othermark
Copy link

Save custom schema error: Firebase.set failed: First argument contains an invalid key ($ref) in property 'schemas.xOW3vBZG7JSxJcqfilsEdUJ0ZnI2.Pool.items.0'. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"

{
"type": "array",
"items": [
{
"$ref": "repository://Pool_member"
}
],
"title": "Pool",
"description": "Pool"
}

@tangram-js
Copy link
Owner

Thank you for point out the bug, it's fixed now.

@othermark
Copy link
Author

This only seems to work for top level items since your fix doesn't recurse into the anonymous array where $refs are held because of the !Array.isArrayType(value)

example:

{
    "type": "object",
    "properties": {
        "member": {
            "oneOf": [
                {
                    "$ref": "repository://IPv4 Address"
                },
                {
                    "$ref": "repository://IPv6 Address"
                }
            ]
        },
        "Port": {
            "$ref": "repository://Port"
        }
    },
    "title": "PoolMember",
    "description": "Pool Member"
}

@tangram-js
Copy link
Owner

Wow! You are right! It's fixed and thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants