guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: allow to use nullable union type not only for oneOf case

iperevozchikov opened this issue · comments

Hi, @ebrehault!

A few monthes ago I was implemented #397 proposal to support nullable union types. And everything was good until yesterday while we not decided to move our selects to new type of widget like autocomplete and without using of oneOf property.
But constraint that I implemented in proposal doesn't allow to use this.

Another problem from my previous solution is buggy types in Schema type definition.

So in that issue I want to do the next job:

  1. Remove constraint of using only with oneOf
  2. Add null type as new FieldType
  3. Add NullProperty, which will return null as fallback value
  4. Update StringProperty to allow to return null as fallback value if property has nullable union.
  5. Fix types in ISchema

@ebrehault I see that you merged PR thanks! But still have a question about npm - could you publish new version of library there with my changes?

Hi @iperevozchikov !
Yes sure, version 2.6.7 is now on npm.
By the way, for your future PRs, if you update the version number in projects/schema-form/package.json and add an entry in CHANGELOG.md, then GitHub Actions will automatically tag and publish to npm at the time the PR is merge :)

example here: 426af24

Got it, thanks for advice!