generator-nokode 1.0.1 → 1.0.3

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.
@@ -17,7 +17,7 @@ export default class NokodeGenerator extends BaseGenerator {
17
17
  this._writeDir('./gradle');
18
18
  this._writeFile('build.sh');
19
19
  this._writeFile('build.gradle');
20
- this._writeFile('.gitignore');
20
+ this._writeFileWithPaths('gitignore.template', '.gitignore');
21
21
  this._writeFile('gradlew');
22
22
  this._writeFile('gradlew.bat');
23
23
  this._writeFile('settings.gradle');
@@ -1,5 +1,9 @@
1
1
  package <%=packageName%>.config.openapi;
2
2
 
3
+ import java.util.HashSet;
4
+ import java.util.Map;
5
+ import java.util.Set;
6
+
3
7
  import org.springdoc.core.customizers.OperationCustomizer;
4
8
  import org.springframework.context.annotation.Bean;
5
9
  import org.springframework.context.annotation.Configuration;
@@ -8,10 +12,12 @@ import org.springframework.web.method.HandlerMethod;
8
12
  import <%=packageName%>.config.constants.<%=appNameTitleCase%>Constants;
9
13
  import io.swagger.v3.oas.models.Components;
10
14
  import io.swagger.v3.oas.models.OpenAPI;
15
+ import org.springdoc.core.customizers.OpenApiCustomizer;
11
16
  import io.swagger.v3.oas.models.Operation;
12
17
  import io.swagger.v3.oas.models.info.Info;
13
18
  import io.swagger.v3.oas.models.security.SecurityRequirement;
14
19
  import io.swagger.v3.oas.models.security.SecurityScheme;
20
+ import io.swagger.v3.oas.models.media.Schema;
15
21
 
16
22
  @Configuration
17
23
  public class OpenAPIConfig {
@@ -19,7 +25,7 @@ public class OpenAPIConfig {
19
25
  @Bean
20
26
  OpenAPI customOpenAPI() {
21
27
  return new OpenAPI()
22
- .info(new Info().title("<%= appName %> API").version("1.0.0"))
28
+ .info(new Info().title("<%= appName %>").version("1.0.0"))
23
29
  .components(new Components()
24
30
  .addSecuritySchemes("JWT", new SecurityScheme()
25
31
  .type(SecurityScheme.Type.APIKEY)
@@ -45,4 +51,31 @@ public class OpenAPIConfig {
45
51
  return c;
46
52
  }
47
53
 
54
+ @Bean
55
+ OpenApiCustomizer nullableOptionalFieldsCustomizer() {
56
+ return new OpenApiCustomizer() {
57
+ @Override
58
+ @SuppressWarnings({"rawtypes", "unchecked"})
59
+ public void customise(OpenAPI openApi) {
60
+ if (openApi.getComponents() != null && openApi.getComponents().getSchemas() != null) {
61
+ for (Schema schema : openApi.getComponents().getSchemas().values()) {
62
+ if (schema.getProperties() == null) {
63
+ continue;
64
+ }
65
+ ((Map<String, Schema>) schema.getProperties()).forEach((String name, Schema value) -> {
66
+ if (schema.getRequired() == null || !schema.getRequired().contains(name)) {
67
+ Set<String> types = value.getTypes();
68
+ if (types == null) {
69
+ types = new HashSet<>();
70
+ }
71
+ types.add("null");
72
+ value.setTypes(types);
73
+ }
74
+ });
75
+ }
76
+ }
77
+ }
78
+ };
79
+ }
80
+
48
81
  }
@@ -0,0 +1,37 @@
1
+ HELP.md
2
+ .gradle
3
+ build/
4
+ !gradle/wrapper/gradle-wrapper.jar
5
+ !**/src/main/**/build/
6
+ !**/src/test/**/build/
7
+
8
+ ### STS ###
9
+ .apt_generated
10
+ .classpath
11
+ .factorypath
12
+ .project
13
+ .settings
14
+ .springBeans
15
+ .sts4-cache
16
+ bin/
17
+ !**/src/main/**/bin/
18
+ !**/src/test/**/bin/
19
+
20
+ ### IntelliJ IDEA ###
21
+ .idea
22
+ *.iws
23
+ *.iml
24
+ *.ipr
25
+ out/
26
+ !**/src/main/**/out/
27
+ !**/src/test/**/out/
28
+
29
+ ### NetBeans ###
30
+ /nbproject/private/
31
+ /nbbuild/
32
+ /dist/
33
+ /nbdist/
34
+ /.nb-gradle/
35
+
36
+ ### VS Code ###
37
+ .vscode/
@@ -3,8 +3,8 @@
3
3
  SPRING_BOOT_VERSION: '3.5.5',
4
4
  SPRING_PLUGIN_VERSION: '1.1.7',
5
5
  SPRINGDOC_PLUGIN_VERSION: '1.9.0',
6
- SPRINGDOC_OPENAPI_VERSION: '2.8.9',
7
- SIXSPRINTS_AUTH_VERSION: '3.5.508',
6
+ SPRINGDOC_OPENAPI_VERSION: '2.8.13',
7
+ SIXSPRINTS_AUTH_VERSION: '3.5.511',
8
8
  SIXSPRINTS_CLOUD_STORAGE_API_VERSION: '2.0.1',
9
9
  MAPSTRUCT_VERSION: '1.6.3',
10
10
  LOMBOK_MAPSTRUCT_BINDING_VERSION: '0.2.0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-nokode",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A Yeoman generator for creating Spring Boot applications with Nokode framework",
5
5
  "main": "index.js",
6
6
  "type": "module",