Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add ability to pass custom types for a string given a format hint #1383

Open
paulst-cais opened this issue May 17, 2024 · 0 comments · May be fixed by #1384
Open

[Feature] Add ability to pass custom types for a string given a format hint #1383

paulst-cais opened this issue May 17, 2024 · 0 comments · May be fixed by #1384
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@paulst-cais
Copy link

What are the steps to reproduce this issue?

  1. Parse a property that is type: string, but also contains the format hint, e.g. format: date-time

What happens?

There is config to parse these as a Date, but I want to be able to parse as a custom type.

What were you expecting to happen?

I was expecting this, but it would nice to have some more control.

I have a solution to allow a new config item, that will pass a format and return a type string:

if (context.output.override.customStringFormatResolver && item?.format) {
    const type = context.output.override.customStringFormatResolver(item.format);
    if (type) {
      value = type;
    }
}

Any logs, error output, etc?

N/A

Any other comments?

Happy to implement this as a PR

What versions are you using?

Operating System:
Package Version:
Browser Version:

@melloware melloware added the enhancement New feature or request label May 17, 2024
@melloware melloware added this to the 6.30.0 milestone May 17, 2024
@melloware melloware modified the milestones: 6.30.0, 6.31.0 Jun 7, 2024
@melloware melloware modified the milestones: 6.31.0, 6.32.0 Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants