feat(models): add address to OrganizationalEntity - #1513
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 15 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Thank you for your effort. I see this PR mixing scopes. It addresses 2 topics at once:
Please split this into two independent, scoped pull requests - each targeting a single ticket/issue. cyclonedx-javascript-library/CONTRIBUTING.md Lines 8 to 15 in ed03365 |
This comment was marked as outdated.
This comment was marked as outdated.
Adds optional address field (OrganizationalContact) to OrganizationalEntity and serialises it in JSON and XML output. Closes CycloneDX#1251 Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
c72f54d to
1b3bdbf
Compare
|
Done — the PR is now scoped to the The AI Tool Disclosure section is now filled in in the PR description (OpenAI Codex CLI / GPT-5-Codex, with the prompts used). Apologies for missing it initially — thanks for pointing it out. |
jkowalleck
left a comment
There was a problem hiding this comment.
implementation seams off -- see details below.
additionally, tests are missing - please add the new capabilities to the createComplexStructure in file tests/_data/models.js and have the test running and snapshots updated.
see https://github.com/CycloneDX/cyclonedx-javascript-library/blob/main/tests/README.md
| ...this._factory.makeForOrganizationalContact().normalizeIterable(data.contact, options, 'contact') | ||
| ...this._factory.makeForOrganizationalContact().normalizeIterable(data.contact, options, 'contact'), | ||
| ...(data.address === undefined | ||
| ? [] |
There was a problem hiding this comment.
i'd rather not omit the field at all, than having an empty list.
| ? [] | |
| ? undefined |
| name?: string | ||
| url: Set<URL | string> | ||
| contact: OrganizationalContactRepository | ||
| address?: OrganizationalContact |
There was a problem hiding this comment.
nope, per CycloneDX spec, an org's address is not an OrganizationalContact,
but a different type PostalAddress -
see https://github.com/CycloneDX/specification/blob/4d1842b78fb394c9bf7f6c49398513adebaa0a9b/schema/bom-1.7.schema.json#L824-L827
Signed-off-by: Shurong Cao <170531907+CAOShurong@users.noreply.github.com>
|
Addressed the review feedback in
Verification completed: 4169 Node tests passing, Node/Web builds passing, declaration compilation, TypeScript lint, ESLint, dependency check, and code-style check all pass. |
Closes #1251
Summary
Adds optional
PostalAddresssupport for theOrganizationalEntity.addressfield introduced in CycloneDX 1.6, with correct JSON and XML serialisation.Changes
Models.PostalAddressmodel with country, region, locality, post office box, postal code, and street address fields.OrganizationalEntity.addressnow usesPostalAddress, is emitted only for CycloneDX 1.6 and newer, and follows the schema element/property order.contactcollections remain omitted from output.createComplexStructureand refreshed 1.6/1.7 JSON/XML normalization and serialization snapshots.Verification
npm run build:node)npm run build:web)npx tsc -b tsconfig.d.json)npm run test:node)npm run test:lint)npm run test:standard)npm run test:dependencies)npm run cs-fix)AI Tool Disclosure
OpenAI Codex CLIGPT-5-CodexAsked to continue PR #1513, address reviewer feedback by introducing PostalAddress, add JSON/XML serialization coverage and snapshots, run the complete verification suite, and push the fix to the existing PR.