Skip to content

Enable custom renderers for specific filenames with fallback to default renderer #17186

Open
@LugaMuga

Description

@LugaMuga

Feature Description

We want to add a custom renderer for spring-configuration-metadata.json files. It's a file where you describe possible application properties. I've already written it, but I don't want to use it for all JSON files.

As I see a code, it's too hard to change property

FILE_EXTENSIONS = .json

to something like

FILE_REGEXP = spring-*.json

I think we can add two new properties:

  1. GET_REAL_FILENAME = true/false - and if you are using IS_INPUT_FILE = true, the system will get your real name with some static prefix
  2. FALLBACK_POLICY = default_renderer / error - if external renderer finished with error, the system can show file by default renderer or send an error to UI

These two properties will possible for us to resolve our task.
I can try to implement this logic but want to get approval from you for this solution.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/content-renderingChanges how certain filetypes are displayedtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions