question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Schema property alternative names

See original GitHub issue

I would like to suggest to extend schema property by “alternativeName”:

"type" : "object",
"properties : {
     "property1" : {
            "type" : "string",
            "alternativeNames" : [
                  "Property1"                   
            ]
     }
}

That to me seems advantage in case of generation clients for 3rd-party-API that it is even not describe by openapi.json especially to reuse “objects type” that just differentiated in case of letters in properties.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:10
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
bougarcommented, Jun 12, 2020

This would make sense in case I wanted to rename a property name without breaking compatibility with previous versions. The behavior, at least in my use case, would be similar to JsonAlias in Java.

1reaction
Loicgeo-procommented, Sep 24, 2020

Hi all, I have a need also to digest a JSON having some strange names as input and I don’t have the hand to change its specification.

Read more comments on GitHub >

github_iconTop Results From Across the Web

alternateName - Schema.org Property
Schema.org Property: alternateName - An alias for the item.
Read more >
39 Synonyms & Antonyms for SCHEMA - Thesaurus.com
synonyms for schema · architecture · arrangement · blueprint · chart · comp · composition · conception · constitution ...
Read more >
JSON schema where keys have different names
You can do this with the additionalProperties keyword. In this example, every property in the object must validate against the given schema.
Read more >
Proposal for restricting property names - Google Groups
all property names of the instance object matches the provided regular expression. ... If you wanted to use different names's for different schemas,...
Read more >
object — Understanding JSON Schema 2020-12 documentation
The value of properties is an object, where each key is the name of a property and each value is a schema used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found