DependencyTrack / DependencyTrack/dependency-track

Field possibly erroneously set as `Schema.RequiredMode.REQUIRED`

Open
#6,018 0 comments 0 reactions 0 assignees View on GitHub
defect in triage
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior

https://github.com/DependencyTrack/dependency-track/blob/626a0cbf1525fe75d1e00ef3423086173ce58963/src/main/java/org/dependencytrack/model/RepositoryMetaComponent.java#L84-L90

Comment says it's optional and from a quick search through the code base it appears to indeed be conditionally set, not set at all, etc.

This may cause issues for generated OpenAPI clients which assume that the field is always set.

### Steps to Reproduce

An API call to `/v1/repository/latest` may return data such as:
```json
{
"repositoryType": "NPM",
"name": "buffer",
"latestVersion": "6.0.3",
"lastCheck": 1775555220982
}
```
in which `published` is absent.

### Expected Behavior

Either `published` to always have some value (`0`?) or, for it not be set as required.

### Dependency-Track Version

4.13.3

### Dependency-Track Distribution

Container Image

### Database Server

N/A

### Database Server Version

_No response_

### Browser

N/A

### Checklist

- [x] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [x] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.