Horreum
Horreum copied to clipboard
Bump org.openapitools:openapi-generator-maven-plugin from 7.4.0 to 7.5.0
Bumps org.openapitools:openapi-generator-maven-plugin from 7.4.0 to 7.5.0.
You can trigger a rebase of this PR by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebase
will rebase this PR -
@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it -
@dependabot merge
will merge this PR after your CI passes on it -
@dependabot squash and merge
will squash and merge this PR after your CI passes on it -
@dependabot cancel merge
will cancel a previously requested merge and block automerging -
@dependabot reopen
will reopen this PR if it is closed -
@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency -
@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Note Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
It looks like the updated openapi generator vesion generates some code with issues, in particular in the file src/generated/models/ChangeDetectionConfig.ts
:
The new generated code is:
export function ChangeDetectionConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeDetectionConfig {
if (json == null) {
return json;
}
switch (json['model']) {
case 'fixedThreshold':
return Object.assign({}, FixedThresholdDetectionConfigFromJSONTyped(json, true), { model: 'fixedThreshold' });
case 'relativeDifference':
return Object.assign({}, RelativeDifferenceDetectionConfigFromJSONTyped(json, true), { model: 'relativeDifference' });
default:
throw new Error(`No variant of ChangeDetectionConfig exists with 'model=${json['model']}'`);
}
}
With build error:
error TS2322: Type 'RelativeDifferenceDetectionConfig & { model: string; }' is not assignable to type 'ChangeDetectionConfig'.
Type 'RelativeDifferenceDetectionConfig & { model: string; }' is not assignable to type '{ model: "relativeDifference"; } & RelativeDifferenceDetectionConfig'.
Type 'RelativeDifferenceDetectionConfig & { model: string; }' is not assignable to type '{ model: "relativeDifference"; }'.
Types of property 'model' are incompatible.
Type 'string' is not assignable to type '"relativeDifference"'.
Before the update it was:
export function ChangeDetectionConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeDetectionConfig {
if (json == null) {
return json;
}
switch (json['model']) {
case 'fixedThreshold':
return {...FixedThresholdDetectionConfigFromJSONTyped(json, true), model: 'fixedThreshold'};
case 'relativeDifference':
return {...RelativeDifferenceDetectionConfigFromJSONTyped(json, true), model: 'relativeDifference'};
default:
throw new Error(`No variant of ChangeDetectionConfig exists with 'model=${json['model']}'`);
}
}
Thus, the issue looks like in the generated Object.assign(...)
method rather than {...Obj1, key: value}
obj merge approach.
After deep dive I noticed that there are also some issues in the horreum-api
schemas for:
-
ChangeDetection
(especially how the discriminator is set, with https://github.com/Hyperfoil/Horreum/pull/1610/commits/d434b78aa3892581d0e614e1e669055183230889 it looks better) - and for
importTableReportConfig
body (with https://github.com/Hyperfoil/Horreum/pull/1610/commits/38df022e29d28d8dd80a227a032867c6727bf13d I set the body to ofTableReportConfig
type, in addition I fixed how the body is persisted in the db)
@lampajr thanks for looking at this
A newer version of org.openapitools:openapi-generator-maven-plugin exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.
@dependabot rebase
Looks like this PR has been edited by someone other than Dependabot. That means Dependabot can't rebase it - sorry!
If you're happy for Dependabot to recreate it from scratch, overwriting any edits, you can request @dependabot recreate
.
@dependabot recreate
Superseded by #1972.