url fields cannot have url parameter in config
See original GitHub issueAs per schema, method fields are not allowed to have additional properties. Which is fine in general, but causes error message when using the url
parameter of url fields [1] although it can be used according to the respective code ([2], [3]). The page also renders perfectly fine and formats the url with the expected value.
My first thought was to just change the schema to either allow additional properties or to include the url
parameter. But to be honest: I don’t like either of those. Instead, I tried to create some conditional dependency in the schema based on the the value of the type
field but I did not manage to make that working (aside from that fact that this created way more JSON schema than I am willing to accept personally).
So, if anyone has an idea on how to fix this, I would be glad for input. Thanks in advance!
[1]
"fields": [
// [...]
{
"name": "someValue",
"type": "url",
"label": "External",
"url": "http://example.com/products/:someValue"
}
]
[2] https://github.com/dsternlicht/RESTool/blob/f7b6e0283eba38eb7aa76f8c3acf4bafc8ccd61b/src/components/table/table.comp.tsx#L35 [3] https://github.com/dsternlicht/RESTool/blob/f7b6e0283eba38eb7aa76f8c3acf4bafc8ccd61b/src/components/cards/cards.comp.tsx#L38
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
I added some docu in #126
Thanks for the heads-up 😃 I skimmed over the changes prior to experiencing this problem and did not remember that is was already fixed upstream.