Comments (8)
Isn't that expected, though? The title
should replace the display name of a key. This is how it works for predefined keys as well.
from django-jsonform.
It makes sense in predefined keys because those are static, and also in the items of a list.
But in additional properties this happens:
Internally the json is
{
"bar":
{
"Original name": "translated_name"
},
"foo":
{
"original_name": "translated_name"
}
}
There's no way no know in the admin which additional key you're editing.
In our case due to a lack of help_text for this, we're using the title for to provide that information. But even if that was added, title would still hide the additional key, which causes the issue.
from django-jsonform.
I'll add support for help_text
or the description
keyword.
It will be displayed right below the title (key name).
Will that work for you?
from django-jsonform.
That would work for us.
Will the title still override the key name in additionalProperties?
With help_text
o description
our use case will still be solved, but I still think that using title shouldn't hide the dynamic keys.
from django-jsonform.
See my comment on #115 (comment)
from django-jsonform.
See my comment on #115 (comment)
I understood that as removing the "beautifying" of the title only, not removing it completely, my bad. Then yeah, the solution will work.
from django-jsonform.
Will the title still override the key name in additionalProperties?
...
but I still think that using title shouldn't hide the dynamic keys.
Yes, if a title is provided it will override the key for display text.
The problem with displaying both is deciding on a format, such as:
<key> - <title>
— key before title<title> - <key>
— title before key<key> (<title>)
— title in parenthesis<key> <title>
— no dash
Everybody will have different requirements. This will require some sort of string formatting to meet everyone's needs.
Maybe I'll consider adding it in future, but not right now.
from django-jsonform.
Added support for the description
keyword in v2.18.0. Please upgrade and test it out.
Thank you for reporting the issue.
from django-jsonform.
Related Issues (20)
- Custom validation of object properties not showing error next to field HOT 2
- Form dynamics not working after reloading django-jsonform with HTMX HOT 3
- Using an object with empty Properties, having all properties inside AdditionalProperties HOT 3
- Setting JSONField schema dynamically HOT 3
- Copy-pasting / Duplications for Array items and Objects
- Horizontal display of properties HOT 1
- Dynamic header generation for array items HOT 2
- Customising "Add key" and "Add item" texts HOT 1
- Add button to open link in URLField HOT 5
- Decimal values not allowed when entering integer minimum and maximum for 'number' types HOT 4
- Define defaults for an array HOT 3
- Subfields in ArrayField should get the relevant input type
- Issue with errors for fields inside an anyOf schema not displaying correctly HOT 1
- validators for jsonfield are not updated with dynamic schema HOT 3
- Cooperation with other repository `django-pydantic-field` for model schema validation HOT 1
- Title is not populated for `oneOf` when referenced through `$ref` HOT 3
- tests dir in .venv broke project tests HOT 1
- JSONFieldWidget attrs HOT 1
- Bug: Nullable Subschema (anyOf with `null`) causes UI exception
- Type annotations / stubs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-jsonform.