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

transform Addtions (WIP) #66

Open
8 tasks
willfarrell opened this issue Apr 23, 2018 · 4 comments · May be fixed by #262
Open
8 tasks

transform Addtions (WIP) #66

willfarrell opened this issue Apr 23, 2018 · 4 comments · May be fixed by #262
Labels

Comments

@willfarrell
Copy link
Contributor

willfarrell commented Apr 23, 2018

Just jotting down notes for after #64 is merged

  • Allow options, similar to dynamicDefaults

  • toEnumCase have option to ignore certain char when determining uniqueness ie strip out , and -

  • replace string or regex

  • strip html tags w/ options (alias of replace w/ defaults)

  • review idea of having addons for more complex/custom transforms

    • xss
  • leftPad/rightPad/regexPad/patternCoerce string. ie 1:45 -> 01:45:00.000

  • floor/ceil number

Options: (WIP)

{
  "type":"object",
  "transforms":{
    "$defaults":{
    },
    "name":{
      "toEnumCase":{"ignorePattern":"[\.]", "ignore":[",","-"]}
    },
    "time":{
      
    }
  }
}

Ref: #64

@khaledosama999
Copy link

khaledosama999 commented Feb 23, 2021

Instead of trying to include all the cases for the possible needed transform see if it's possible to have the transform keyword take a custom function

{
transform:['trim', (x) => x+'string']
}

@willfarrell
Copy link
Contributor Author

@khaledosama999 having javascript inside of json will break other things (linter for example). ajv v7 has some new abilities that allow #99 to be more possible. I can see the transform keyword disappearing at some point in favour of a collection of custom keywords that can do the transform.

@khaledosama999
Copy link

So right now what is the solution? I want to encode incoming URLs that include spaces so is there any way to do that right now ?

@willfarrell
Copy link
Contributor Author

There isn't a solution right now that I'm aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants