• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

accordproject / concerto-codegen / 25956591474
98%

Build:
DEFAULT BRANCH: main
Ran 16 May 2026 07:51AM UTC
Jobs 3
Files 30
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 May 2026 07:50AM UTC coverage: 98.35% (+0.006%) from 98.344%
25956591474

push

github

web-flow
feat(jsonschema): add includeTypeTag and defaultsAreOptional options (#213)

* feat(jsonschema): add includeTypeTag and defaultsAreOptional options

JSONSchemaVisitor always emits a `$class` property (with default + pattern)
on every object schema and always lists every non-optional Concerto property
in the JSON Schema `required` array — even those that declare a default
value. Both behaviors are useful for round-tripping Concerto instances but
are awkward for consumers that only see plain JSON data and legitimately
omit defaulted fields.

This change adds two additive, opt-in parameters that pass through the
existing visitor `parameters` object alongside `rootType`, `inlineTypes`,
and `refRoot`:

- `includeTypeTag: false` — suppresses `$class` from both `properties` and
  `required`. Other properties and requireds are unchanged.
- `defaultsAreOptional: true` — excludes any property that declares a
  non-null default value from the generated `required` array. Applies to
  user properties and to `$class` itself (whose implicit default is the
  fully-qualified class name).

Both parameters default to their historical behavior (type tag included;
defaulted fields required), so existing consumers see no change. Class-
level JSDoc documents the new options.

7 new test cases cover: backward-compatible default emission, each option
individually in both on/off positions, and both options combined. Existing
569 tests unchanged; 576 total passing.

Motivation: downstream consumers (e.g. contract template generators that
feed `jsonschema.Draft7Validator` against plain-JSON request payloads
without the Concerto `$class` tag) currently work around both behaviors
with post-processing. These options let them opt out cleanly at codegen.

Signed-off-by: Yuzhou Wang <wusiwyzb5@gmail.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <7544022+mttrbrts@use... (continued)

1459 of 1513 branches covered (96.43%)

Branch coverage included in aggregate %.

8 of 8 new or added lines in 1 file covered. (100.0%)

2951 of 2971 relevant lines covered (99.33%)

10156.28 hits per line

Jobs
ID Job ID Ran Files Coverage
1 windows-latest - 25956591474.1 16 May 2026 07:51AM UTC 30
98.35
GitHub Action Run
2 ubuntu-latest - 25956591474.2 16 May 2026 07:51AM UTC 30
98.35
GitHub Action Run
3 macOS-latest - 25956591474.3 16 May 2026 07:51AM UTC 30
98.35
GitHub Action Run
Source Files on build 25956591474
  • Tree
  • List 30
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 19fc1727 on github
  • Prev Build on main (#25940228456)
  • Next Build on main (#25956683159)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc