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

spec: allow number types to be ints, strings, and/or variables #11

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

kerolasa
Copy link
Collaborator

@kerolasa kerolasa commented Aug 5, 2024

After this change numbers are always quoted after reformatting. That is the only way to be somewhat consistent what is the representation format when %variables% need to be supported, and they need to be strings.

As a practical example, one could have the following in a template (and it would fail, but it's obvious why - see the hostname).

"records": [
    {
        "type": "A",
        "host": "the-ttl-is-plain-number-this-is-ok",
        "ttl": 1800
    },
    {
        "type": "A",
        "host": "the-ttl-is-quoted-number-this-is-ok",
        "ttl": "8100"
    },
    {
        "type": "A",
        "host": "the-ttl-is-variable-this-is-ok",
        "ttl": "%varttl%"
    },
    {
        "type": "A",
        "host": "ttl-is-BROKEN-it-cannot-be-just-a-string",
        "ttl": "just-a-string"
    }
]

Reference: Domain-Connect/spec#100

@kerolasa kerolasa requested a review from pawel-kow August 5, 2024 10:15
After this change numbers are always quoted after reformatting.  That is the
only way to be somewhat consistent what is the representation format when
%variables% need to be supported, and they need to be strings.

As a practical example, one could have the following in a template (and it
would fail, but it's obvious why - see the hostname).

    "records": [
        {
            "type": "A",
            "host": "the-ttl-is-plain-number-this-is-ok",
            "ttl": 1800
        },
        {
            "type": "A",
            "host": "the-ttl-is-quoted-number-this-is-ok",
            "ttl": "8100"
        },
        {
            "type": "A",
            "host": "the-ttl-is-variable-this-is-ok",
            "ttl": "%varttl%"
        },
        {
            "type": "A",
            "host": "ttl-is-BROKEN-it-cannot-be-just-a-string",
            "ttl": "just-a-string"
        }
    ]

Reference: Domain-Connect/spec#100
Signed-off-by: Sami Kerola <[email protected]>
The version number must be unsigned integer.  Anything else is just too
difficult to deal with.

Signed-off-by: Sami Kerola <[email protected]>
@kerolasa kerolasa force-pushed the kerolasa/string-interger-variable branch from c54a052 to 5934b51 Compare August 14, 2024 12:43
@kerolasa kerolasa merged commit 5934b51 into main Aug 15, 2024
@kerolasa kerolasa deleted the kerolasa/string-interger-variable branch August 15, 2024 08:14
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

Successfully merging this pull request may close these issues.

1 participant