Git Product home page Git Product logo

Comments (8)

bhch avatar bhch commented on June 16, 2024

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.

alexgmin avatar alexgmin commented on June 16, 2024

It makes sense in predefined keys because those are static, and also in the items of a list.
But in additional properties this happens:

image

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.

bhch avatar bhch commented on June 16, 2024

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.

alexgmin avatar alexgmin commented on June 16, 2024

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.

bhch avatar bhch commented on June 16, 2024

See my comment on #115 (comment)

from django-jsonform.

alexgmin avatar alexgmin commented on June 16, 2024

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.

bhch avatar bhch commented on June 16, 2024

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.

bhch avatar bhch commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.