@team-supercharge/oasg 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +1 -1
- package/CHANGELOG.md +14 -0
- package/bin/merger.js +21 -0
- package/bin/oasg +2 -1
- package/package.json +1 -1
- package/targets/feign/generate.sh +1 -1
package/.gitlab-ci.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [4.0.2](https://gitlab.com/team-supercharge/oasg/compare/v4.0.1...v4.0.2) (2022-03-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* replace references in mappings of discriminator ([1cc5b67](https://gitlab.com/team-supercharge/oasg/commit/1cc5b67003da1a937b60736f383db78d0524cdc5))
|
|
11
|
+
|
|
12
|
+
### [4.0.1](https://gitlab.com/team-supercharge/oasg/compare/v4.0.0...v4.0.1) (2022-03-18)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add missing default generatorId mapping for feign clients ([5a8f7bf](https://gitlab.com/team-supercharge/oasg/commit/5a8f7bf57f13b666ff6cbcb652634352a4d8b96f))
|
|
18
|
+
|
|
5
19
|
## [4.0.0](https://gitlab.com/team-supercharge/oasg/oasg/compare/v3.2.0...v4.0.0) (2021-08-30)
|
|
6
20
|
|
|
7
21
|
|
package/bin/merger.js
CHANGED
|
@@ -64,6 +64,17 @@ function getAllReferencedFiles(document, files) {
|
|
|
64
64
|
for (var keys in document) {
|
|
65
65
|
//checking if the current value is an object itself
|
|
66
66
|
if (typeof document[keys] === 'object') {
|
|
67
|
+
if (keys === "discriminator") {
|
|
68
|
+
if ("mapping" in document[keys] && typeof document[keys].mapping === 'object') {
|
|
69
|
+
for (var mappingKey in document[keys].mapping) {
|
|
70
|
+
if (document[keys].mapping[mappingKey].startsWith(".")) {
|
|
71
|
+
const externalFilePath = document[keys].mapping[mappingKey].split('#')[0];
|
|
72
|
+
files.add(externalFilePath);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
67
78
|
// if so then again calling the same function
|
|
68
79
|
getAllReferencedFiles(document[keys], files)
|
|
69
80
|
} else {
|
|
@@ -120,6 +131,16 @@ function updateReferences(document, oldValue, newValue) {
|
|
|
120
131
|
for (var keys in document) {
|
|
121
132
|
//checking if the current value is an object itself
|
|
122
133
|
if (typeof document[keys] === 'object') {
|
|
134
|
+
if (keys === "discriminator") {
|
|
135
|
+
if ("mapping" in document[keys] && typeof document[keys].mapping === 'object') {
|
|
136
|
+
for (var mappingKey in document[keys].mapping) {
|
|
137
|
+
if (document[keys].mapping[mappingKey].includes(oldValue)) {
|
|
138
|
+
document[keys].mapping[mappingKey] = document[keys].mapping[mappingKey].replace(oldValue, newValue);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
123
144
|
// if so then again calling the same function
|
|
124
145
|
updateReferences(document[keys], oldValue, newValue)
|
|
125
146
|
} else {
|
package/bin/oasg
CHANGED
package/package.json
CHANGED