@team-supercharge/oasg 8.0.2 → 9.0.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
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
+ ## [9.0.0](https://gitlab.com/team-supercharge/oasg/compare/v8.0.2...v9.0.0) (2023-02-24)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * **spring-kotlin, spring, feign:** skip inline schema reusing by default
11
+
12
+ ### Features
13
+
14
+ * **spring-kotlin, spring, feign:** skip inline schema reusing by default ([c125332](https://gitlab.com/team-supercharge/oasg/commit/c125332cbd59dbd31b2e257060a716950ed3f03a))
15
+
5
16
  ### [8.0.2](https://gitlab.com/team-supercharge/oasg/compare/v8.0.1...v8.0.2) (2023-02-24)
6
17
 
7
18
 
package/README.md CHANGED
@@ -705,6 +705,66 @@ The **"project level"** customization can be configured using the `templateDir`
705
705
 
706
706
  This section covers the breaking changes and their migrations across major version upgrades.
707
707
 
708
+ ### From `8.x.x` to `9.0.0`
709
+
710
+ #### Skip Reusing Schemas in `spring-kotlin`, `spring` and `feign`
711
+
712
+ The newer versions of OpenAPI Generator adds the flag to skip the [automatic inline schema reusing](https://openapi-generator.tech/docs/customization/#inline-schema-naming) logic (see example what this means below).
713
+
714
+ From _OASg_ 9.0.0 the **default and recommended behaviour is to skip schema reusing** for the targets above. If you wish to resume schema reusing for compatibility reasons, add `--inline-schema-name-defaults SKIP_SCHEMA_REUSE=false` to `generatorCustomArgs` in the project's `config.json`
715
+
716
+ Take the following schema:
717
+
718
+ ```yaml
719
+ schemas:
720
+ Message:
721
+ type: object
722
+ properties: # messages have a topic and text
723
+ topic:
724
+ type: object
725
+ properties: # topics have id and name
726
+ id:
727
+ type: string
728
+ name:
729
+ type: string
730
+ text:
731
+ type: string
732
+
733
+ User:
734
+ type: object
735
+ properties: # users have a company, and firstName and lastName
736
+ company:
737
+ type: object
738
+ properties: # copmanies have id and name
739
+ id:
740
+ type: string
741
+ name:
742
+ type: string
743
+ firstName:
744
+ type: string
745
+ lastName:
746
+ type: string
747
+ ```
748
+
749
+ Previously the following DTO objects were generated from this schema:
750
+
751
+ ```java
752
+ Message(MessageTopic topic, String text)
753
+ MessageTopic(String id, String name)
754
+ User(MessageTopic company, String firstName, String lastName)
755
+ ```
756
+
757
+ Previously the generator reused internal schemas which had the exact same fields, ending up with a `MessageTopic` object for the users' Company, just because both had `id` and `name` string properties.
758
+
759
+ With defining `SKIP_SCHEMA_REUSE=true` the output will be more verbose, but schema names won't get mixed up:
760
+
761
+ ```java
762
+ Message(MessageTopic topic, String text)
763
+ MessageTopic(String id, String name)
764
+ User(UserCompany company, String firstName, String lastName)
765
+ UserCompany(String id, String name)
766
+ ```
767
+
708
768
  ### From `7.x.x` to `8.0.0`
709
769
 
710
770
  #### Linting
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "8.0.2",
3
+ "version": "9.0.0",
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",
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "inlineSchemaNameDefaults": {
21
21
  "arrayItemSuffix": "",
22
- "mapItemSuffix": ""
22
+ "mapItemSuffix": "",
23
+ "SKIP_SCHEMA_REUSE": "true"
23
24
  }
24
25
  }
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "inlineSchemaNameDefaults": {
22
22
  "arrayItemSuffix": "",
23
- "mapItemSuffix": ""
23
+ "mapItemSuffix": "",
24
+ "SKIP_SCHEMA_REUSE": "true"
24
25
  }
25
26
  }
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "inlineSchemaNameDefaults": {
22
22
  "arrayItemSuffix": "",
23
- "mapItemSuffix": ""
23
+ "mapItemSuffix": "",
24
+ "SKIP_SCHEMA_REUSE": "true"
24
25
  }
25
26
  }