guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
485 stars 174 forks source link

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

Closed iperevozchikov closed 2 years ago

iperevozchikov commented 2 years ago

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
iperevozchikov commented 2 years ago

PR: #413

iperevozchikov commented 2 years ago

@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?

ebrehault commented 2 years ago

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 :)

ebrehault commented 2 years ago

example here: https://github.com/guillotinaweb/ngx-schema-form/commit/426af24763de06c4386e77add873281be407f5e3

iperevozchikov commented 2 years ago

Got it, thanks for advice!