Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 4.8.x branch #953

Merged
merged 75 commits into from
Mar 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
cd39f9d
Add ability to customize the directory path in which the generated fi…
altro3 Dec 4, 2022
8d1582c
Add ability to customize UI templates
altro3 Dec 4, 2022
88dd64f
Fix wrong logic for ui *.js.url properties
altro3 Dec 6, 2022
2656310
Merge pull request #876 from altro3/fixed_859
graemerocher Dec 7, 2022
4b82440
Merge pull request #877 from altro3/custumize_templates
graemerocher Dec 7, 2022
42f77a4
Merge pull request #879 from altro3/fix_jsurl
graemerocher Dec 7, 2022
157aafb
[skip ci] Release v4.8.0
micronaut-build Dec 7, 2022
d021611
Back to 4.8.1-SNAPSHOT
micronaut-build Dec 7, 2022
b6baf1b
Add ability to set visibility level for class fields
altro3 Dec 10, 2022
1ad9288
Fix copy UI resources whe used *.js.url
altro3 Dec 10, 2022
6ec4939
Fixed bug with wrong references for schemas with inheritance, when us…
altro3 Dec 12, 2022
51cdd98
Merge pull request #881 from altro3/fix_copy_ui_resources
graemerocher Dec 12, 2022
068aab1
Merge pull request #884 from altro3/fix_inheritance_shemaname
graemerocher Dec 12, 2022
2488f85
Merge pull request #882 from altro3/field_visibility_level
graemerocher Dec 12, 2022
59c5fa7
New feature: schema decorators
altro3 Dec 13, 2022
2ab2352
New feature: schema decorators
altro3 Dec 13, 2022
45e86e1
Merge remote-tracking branch 'origin/schema_decorators' into schema_d…
altro3 Dec 14, 2022
f6359a3
New feature: schema decorators
altro3 Dec 14, 2022
eb95cfc
Merge pull request #885 from altro3/schema_decorators
graemerocher Dec 14, 2022
4850255
[skip ci] Release v4.8.1
micronaut-build Dec 16, 2022
581a639
Back to 4.8.2-SNAPSHOT
micronaut-build Dec 16, 2022
49be2c2
Minor fix: skip `micronaut.openapi.schema-prefix` and `micronaut.open…
altro3 Dec 18, 2022
95f3954
Fix logic for `micronaut.environment.enabled`.
altro3 Dec 29, 2022
3a7fece
Fix ConcurrentModificationException #894
kevind-wgu Jan 3, 2023
80bcd39
Fix missing import
kevind-wgu Jan 3, 2023
95a8067
Use HashSet directly
kevind-wgu Jan 5, 2023
8d5a970
Merge pull request #895 from kevind-wgu/patch-1
graemerocher Jan 9, 2023
de4cfc6
Merge pull request #891 from altro3/fix_disable_env
graemerocher Jan 9, 2023
976e4f9
Merge pull request #888 from altro3/minor_fix
graemerocher Jan 9, 2023
12460fc
Add processing class level Hidden annotation
altro3 Jan 9, 2023
fb08b3c
Merge pull request #901 from altro3/fix_controller_hidden
graemerocher Jan 10, 2023
d252eeb
Fix java.util collections schemas
altro3 Jan 12, 2023
c31369c
Skip ignored headers
altro3 Dec 29, 2022
c8ed0d1
Fix compilation issue with MultipartBody
ggerbaud Jan 13, 2023
0021c75
Update swagger-ui to 4.15.5
altro3 Jan 12, 2023
898b06d
Merge pull request #892 from altro3/fix_header_auth
graemerocher Jan 17, 2023
3795021
Merge pull request #906 from altro3/update_ui_script
graemerocher Jan 17, 2023
b6a58d1
Merge pull request #905 from altro3/java_util
graemerocher Jan 17, 2023
d83979c
Merge pull request #909 from ggerbaud/fix/907
graemerocher Jan 24, 2023
8f57c02
[skip ci] Release v4.8.2
micronaut-build Jan 24, 2023
eb7d4d9
Back to 4.8.3-SNAPSHOT
micronaut-build Jan 24, 2023
09a0a30
doc: configuration asciidoc macro and build plugin 5.4.x (#922)
wetted Feb 1, 2023
7adf81e
Update swagger-ui-bundle.js (#920)
altro3 Feb 2, 2023
d485bf9
fix: make visitor package internal
sdelamo Feb 2, 2023
9fd1704
ci: Github Actions sync (#925)
sdelamo Feb 2, 2023
3f45820
build: Micronaut Build 5.4.3
sdelamo Feb 2, 2023
d6451c9
fix: process nullable annotations (#923)
altro3 Feb 3, 2023
ec5e5ce
Add getting schema type from JsonValue method.
altro3 Jan 24, 2023
713ccd9
Fixes after review
altro3 Feb 2, 2023
85efbdf
Merge pull request #915 from altro3/enum_json_value
graemerocher Feb 6, 2023
9140e83
Merge pull request #926 from micronaut-projects/make-visitor-package-…
graemerocher Feb 6, 2023
d309b8c
build: Micronaut Build Plugins 5.4.5
sdelamo Feb 6, 2023
ed7f613
[skip ci] Release v4.8.3
micronaut-build Feb 6, 2023
add3031
Back to 4.8.4-SNAPSHOT
micronaut-build Feb 6, 2023
419adad
Fixed wrong byte type detection. Again remove generation schema for c…
altro3 Feb 10, 2023
85c96fa
Merge pull request #930 from altro3/fix_byte_type
graemerocher Feb 13, 2023
5c72b61
[skip ci] Release v4.8.4
micronaut-build Feb 13, 2023
08040ca
Back to 4.8.5-SNAPSHOT
micronaut-build Feb 13, 2023
11c261b
Fixed #933
altro3 Feb 18, 2023
904e5e4
Fix process JsonValue method when it returns another enum
altro3 Feb 22, 2023
ef7e7f7
Fixing typo in documentation (#943)
jvictorcf Mar 2, 2023
582a523
Merge pull request #939 from altro3/fix_enumvalue_method
graemerocher Mar 2, 2023
e0de343
Merge pull request #937 from altro3/rapidoc_fix
graemerocher Mar 2, 2023
b4cc170
Upgrade libraries
altro3 Mar 9, 2023
353509d
Merge pull request #951 from altro3/libs_update
graemerocher Mar 10, 2023
a8afa07
Add protection of duplicate parameters (#950)
altro3 Mar 10, 2023
3fcfdf0
Auto solve problem schema names conflicts for classes with same name,…
altro3 Mar 10, 2023
c4b7760
[skip ci] Release v4.8.5
micronaut-build Mar 10, 2023
ef38cad
Back to 4.8.6-SNAPSHOT
micronaut-build Mar 10, 2023
a1fed21
Merge branch '4.8.x' into merge_4.8
altro3 Mar 11, 2023
a3841b9
Merge branch 4.8.x and fixes after update snapshots
altro3 Mar 11, 2023
eda081b
Fixed accepted-api-changes.json. Added description to api responses
altro3 Mar 11, 2023
d099460
Fixed problem with groovy and ApiResponse annotation
altro3 Mar 12, 2023
ed1393a
Gradle 8.0.2
altro3 Mar 12, 2023
e95d883
Minor fixes
altro3 Mar 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Auto detect text files and perform LF normalization
* text=auto

*.java text
*.html text
*.kt text
*.kts text
*.md text diff=markdown
*.java text eol=lf
*.groovy text eol=lf
*.html text eol=lf
*.kt text eol=lf
*.kts text eol=lf
*.md text diff=markdown eol=lf
*.py text diff=python executable
*.pl text diff=perl executable
*.pm text diff=perl
*.css text diff=css
*.js text
*.sql text
*.q text
*.css text diff=css eol=lf
*.js text eol=lf
*.sql text eol=lf
*.q text eol=lf

*.sh text eol=lf
gradlew text eol=lf
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
graalvm: [ 'latest', 'dev' ]
graalvm: [ 'latest']
java: [ '17' ]
include:
- graalvm: 'dev'
java: '19'
exclude:
- graalvm: 'dev'
java: '17'
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: Free disk space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ plugins {
id 'io.micronaut.build.internal.openapi-base'
id 'io.micronaut.build.internal.module'
}

repositories {
mavenCentral()
google()
}
9 changes: 6 additions & 3 deletions docs-examples/example-groovy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ repositories {
}

dependencies {

testAnnotationProcessor(mn.micronaut.inject.groovy)

testCompileOnly(mn.micronaut.inject.groovy)
testCompileOnly(libs.managed.swagger.annotations)

testImplementation projects.openapi
testImplementation projects.micronautOpenapi
testImplementation(mn.snakeyaml)
testImplementation(mn.micronaut.runtime)
testImplementation(mnGroovy.micronaut.runtime.groovy)
testImplementation(mn.micronaut.validation)
testImplementation(libs.managed.swagger.annotations)
testImplementation(mnValidation.validation)
testImplementation(mn.reactor)
testImplementation(mnTest.micronaut.test.spock)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse
import io.swagger.v3.oas.annotations.tags.Tag
import reactor.core.publisher.Mono

import javax.validation.constraints.NotBlank
import jakarta.validation.constraints.NotBlank
// end::imports
// tag::clazz[]
@Controller("/")
Expand All @@ -38,4 +38,4 @@ class HelloController {
return Single.just("Hello $name, How are you doing?")
}
}
// end::clazz[]
// end::clazz[]
13 changes: 7 additions & 6 deletions docs-examples/example-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ repositories {

dependencies {

testImplementation projects.openapi
testAnnotationProcessor(mn.micronaut.inject.java)

testCompileOnly(mn.micronaut.inject.java)

testImplementation projects.micronautOpenapi
testImplementation(mn.snakeyaml)
testImplementation(mn.micronaut.runtime)
testImplementation(mn.micronaut.inject.java)
testImplementation(mn.micronaut.validation)
testImplementation(libs.managed.swagger.annotations)
testImplementation(mn.reactor)
testImplementation(mnValidation.validation)
testImplementation(libs.managed.swagger.annotations)
testImplementation(mnTest.micronaut.test.junit5)

testCompileOnly(mn.micronaut.inject.java)

testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(mn.logback.classic)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;
import reactor.core.publisher.Mono;

// end::imports[]
Expand All @@ -38,4 +38,4 @@ public Mono<String> greetings(@Parameter(description="The name of the person") @
return Mono.just("Hello " + name + ", How are you doing?");
}
}
// end::clazz[]
// end::clazz[]
10 changes: 6 additions & 4 deletions docs-examples/example-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.kapt)
Expand All @@ -15,7 +17,7 @@ repositories {
}

dependencies {
kapt projects.openapi
kapt projects.micronautOpenapi
kapt(mn.micronaut.inject.java)
kapt(mnValidation.micronaut.validation)

Expand All @@ -25,7 +27,7 @@ dependencies {
testImplementation(mn.reactor)
testImplementation(mn.snakeyaml)
testImplementation(mn.micronaut.runtime)
testImplementation(mn.micronaut.validation)
testImplementation(mnValidation.validation)
testImplementation(libs.kotlin.stdlib.jdk8)
testImplementation(libs.kotlin.reflect)
testImplementation(mnTest.micronaut.test.junit5)
Expand All @@ -49,8 +51,8 @@ test {
}

compileTestKotlin {
kotlinOptions {
jvmTarget = '17'
compilerOptions {
jvmTarget = JvmTarget.JVM_17
javaParameters = true
}
}
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
projectVersion=5.0.0-SNAPSHOT
projectGroup=io.micronaut.openapi

micronautDocsVersion=2.0.0
micronautVersion=4.0.0-SNAPSHOT
micronautTestVersion=4.0.0-SNAPSHOT
groovyVersion=4.0.7
groovyVersion=4.0.9
spockVersion=2.3-groovy-4.0

title=OpenAPI/Swagger Support
Expand Down
15 changes: 11 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
[versions]
managed-swagger = "2.2.8"
managed-javadoc-parser = "0.3.1"
managed-jsoup = "1.15.3"
managed-jsoup = "1.15.4"
managed-slf4j = "2.0.6"
managed-html2md-converter = "0.64.0"
managed-jakarta-validation-api = "3.0.2"

kotlin = "1.8.0"
kotlin = "1.8.10"
jspecify = "0.3.0"
jdt-annotation = "2.2.700"
android-annotation = "1.6.0"
spotbugs-annotations = "4.7.3"

micronaut-security = "4.0.0-SNAPSHOT"
micronaut-serde = "2.0.0-SNAPSHOT"
micronaut-rxjava2 = "2.0.0-SNAPSHOT"
Expand Down Expand Up @@ -42,7 +46,10 @@ managed-slf4j-nop = { module = "org.slf4j:slf4j-nop", version.ref = "managed-slf
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" }
jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml" }
jakarta-validation-api = { module = "jakarta.validation:jakarta.validation-api", version.ref = "managed-jakarta-validation-api" }
spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version.ref = "spotbugs-annotations" }
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
jdt-annotation = { module = "org.eclipse.jdt:org.eclipse.jdt.annotation", version.ref = "jdt-annotation" }
android-annotation = { module = "androidx.annotation:annotation", version.ref = "android-annotation" }

kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
3 changes: 3 additions & 0 deletions openapi-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ micronautBom {
suppressions {
acceptedVersionRegressions.add("swagger-compat")
acceptedLibraryRegressions.add("swagger")

acceptedVersionRegressions.add("jakarta-validation-api")
acceptedLibraryRegressions.add("jakarta-validation-api")
}
}
13 changes: 7 additions & 6 deletions openapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ dependencies {
// this dependency needs to be updated manually. It's used by html2md
api(libs.managed.jsoup)

testImplementation(mn.micronaut.management)
testImplementation(mn.micronaut.runtime)
testImplementation(mnSecurity.micronaut.security)
testImplementation(mnSerde.micronaut.serde.jackson)
testImplementation(mn.micronaut.inject.groovy)
testImplementation(mn.micronaut.inject.groovy.test)
testImplementation(mn.micronaut.inject.java)
testImplementation(mn.micronaut.inject.java.test)
testImplementation(mn.snakeyaml)
testImplementation(mnSecurity.micronaut.security)
testImplementation(mnSerde.micronaut.serde.jackson)
testImplementation(mnRxjava2.micronaut.rxjava2)
testImplementation(mnRxjava3.micronaut.rxjava3)
testImplementation(mnData.micronaut.data.model)
testImplementation(mn.micronaut.management)
testImplementation(mnValidation.validation)
testImplementation(libs.jakarta.validation.api)
testImplementation(libs.jspecify)
testImplementation(libs.jdt.annotation)
testImplementation(libs.android.annotation)
testImplementation(libs.spotbugs.annotations)
}

configurations.configureEach {
Expand Down
2 changes: 2 additions & 0 deletions openapi/openapi-schema-decorators.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
micronaut.openapi.schema-postfix.io.micronaut.openapi.api.v1_0_0=1_0_0
micronaut.openapi.schema-postfix.io.micronaut.openapi.api.v2_0_1=2_0_1
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
import io.swagger.v3.oas.models.servers.ServerVariables;
import io.swagger.v3.oas.models.tags.Tag;

import org.yaml.snakeyaml.LoaderOptions;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.databind.BeanDescription;
Expand All @@ -84,6 +86,7 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactoryBuilder;
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

Expand All @@ -103,11 +106,15 @@ public static ObjectMapper createJson() {
}

public static ObjectMapper createYaml(boolean openapi31) {
YAMLFactory factory = new YAMLFactory();
factory.disable(Feature.WRITE_DOC_START_MARKER);
factory.enable(Feature.MINIMIZE_QUOTES);
factory.enable(Feature.SPLIT_LINES);
factory.enable(Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS);
LoaderOptions loaderOptions = new LoaderOptions();
loaderOptions.setAllowDuplicateKeys(false);
YAMLFactory factory = new YAMLFactoryBuilder(new YAMLFactory())
.loaderOptions(loaderOptions)
.disable(Feature.WRITE_DOC_START_MARKER)
.enable(Feature.MINIMIZE_QUOTES)
.enable(Feature.SPLIT_LINES)
.enable(Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS)
.build();

return create(factory, openapi31);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ abstract class AbstractViewConfig {
protected String jsUrl = "";
protected String finalUrlPrefix;
protected String resourcesContextPath = "/res";
protected String templatePath;
protected boolean isDefaultJsUrl = true;
protected boolean copyResources = true;
protected boolean withFinalUrlPrefixCache = true;
protected Map<String, Object> options = new HashMap<>();

Expand All @@ -61,6 +63,12 @@ protected AbstractViewConfig(String prefix) {

protected abstract List<String> getResources();

public String getTemplatePath() {
return templatePath;
}

public abstract String render(String template, VisitorContext context);

/**
* Adds an option.
*
Expand Down Expand Up @@ -132,6 +140,12 @@ protected String getFinalUrlPrefix(OpenApiViewConfig.RendererType rendererType,
* @return A View config.
*/
static <T extends AbstractViewConfig> T fromProperties(T cfg, Map<String, Object> defaultOptions, Map<String, String> properties) {

String copyResources = properties.get(cfg.prefix + "copy-resources");
if (StringUtils.isNotEmpty(copyResources) && "false".equalsIgnoreCase(copyResources)) {
cfg.copyResources = false;
}

String jsUrl = properties.get(cfg.prefix + "js.url");
if (StringUtils.isNotEmpty(jsUrl)) {
cfg.jsUrl = jsUrl;
Expand All @@ -143,6 +157,11 @@ static <T extends AbstractViewConfig> T fromProperties(T cfg, Map<String, Object
}
}

String templatePath = properties.get(cfg.prefix + "template.path");
if (StringUtils.isNotEmpty(templatePath)) {
cfg.templatePath = templatePath;
}

cfg.options.putAll(defaultOptions);
properties.entrySet().stream().filter(entry -> entry.getKey().startsWith(cfg.prefix))
.forEach(cfg::addAttribute);
Expand Down
Loading