@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  include:
2
2
  - project: team-supercharge/jarvis/jarvis
3
3
  file: jarvis.yml
4
- ref: v6.0.0
4
+ ref: v6.3.0
5
5
 
6
6
  stages:
7
7
  - lint
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
@@ -40,7 +40,8 @@ const DEFAULT_GENERATOR_ID_MAPPING = {
40
40
  "angular": 'typescript-angular',
41
41
  "spring": 'spring',
42
42
  "spring-kotlin": 'kotlin-spring',
43
- "stubby": 'stubby'
43
+ "stubby": 'stubby',
44
+ "feign": 'spring',
44
45
  }
45
46
 
46
47
  let config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
5
5
  "author": "Supercharge",
6
6
  "license": "MIT",
@@ -6,7 +6,7 @@ rm -rf out/$targetId
6
6
  mkdir -p out/$targetId
7
7
 
8
8
  java -jar $binary generate \
9
- -g spring \
9
+ -g $generatorId \
10
10
  -i $openApiFile \
11
11
  -o out/$targetId \
12
12
  -c $(dirname "$0")/generator-config.json \