generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from micronaut-projects/andriy/init
Create an initial version of the JSON schema processors
- Loading branch information
Showing
90 changed files
with
4,827 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
projectVersion=1.0.0-SNAPSHOT | ||
projectGroup=io.micronaut.json-schema | ||
projectGroup=io.micronaut.jsonschema | ||
|
||
title=Micronaut json-schema | ||
projectDesc=TODO | ||
title=Micronaut JSON schema | ||
projectDesc=JSON schema support for Micronaut | ||
projectUrl=https://micronaut.io | ||
githubSlug=micronaut-projects/micronaut-json-schema | ||
developers=Graeme Rocher | ||
developers=Andriy Dmytruk | ||
org.gradle.caching=true | ||
org.gradle.jvmargs=-Xmx1g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
micronaut-json-schema/build.gradle → json-schema-annotations/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
plugins { | ||
id 'io.micronaut.build.internal.json-schema-module' | ||
} | ||
|
||
|
||
|
||
test { | ||
useJUnitPlatform() | ||
} |
55 changes: 55 additions & 0 deletions
55
json-schema-annotations/src/main/java/io/micronaut/jsonschema/JsonSchema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.jsonschema; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* An annotation that signifies that json schema should be created for the object. | ||
* The JSON schema will attempt to mimic the way this object would be serialized. | ||
* | ||
* @since 1.0.0 | ||
* @author Andriy Dmytruk | ||
*/ | ||
@Target({ ElementType.TYPE, ElementType.FIELD }) | ||
public @interface JsonSchema { | ||
|
||
/** | ||
* The title of the JSON schema. | ||
* By default, the class name will be used. | ||
* | ||
* @return The title | ||
*/ | ||
String title() default ""; | ||
|
||
/** | ||
* The description of the JSON schema. | ||
* By default, javadoc of the object will be used. | ||
* | ||
* @return The description | ||
*/ | ||
String description() default ""; | ||
|
||
/** | ||
* The schema's relative or absolute URI. | ||
* The default will create the URI based on class name and configured base URI. | ||
* | ||
* @return The URI | ||
*/ | ||
String uri() default ""; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
plugins { | ||
id("io.micronaut.build.internal.json-schema-module") | ||
} | ||
|
||
dependencies { | ||
compileOnly(mn.micronaut.core.processor) | ||
|
||
implementation(mn.micronaut.http) | ||
api(projects.micronautJsonSchemaAnnotations) | ||
api(mn.jackson.databind) | ||
|
||
testImplementation(mnValidation.validation) | ||
testImplementation(mn.micronaut.inject.kotlin.test) | ||
testImplementation(mn.micronaut.inject.groovy.test) | ||
testImplementation(mn.micronaut.inject.java.test) | ||
testImplementation(mnLogging.logback.classic) | ||
testImplementation(mnLogging.logback.core) | ||
testImplementation(mnLogging.slf4j.api) | ||
testImplementation(mnLogging.slf4j.simple) | ||
} | ||
|
||
|
||
test { | ||
useJUnitPlatform() | ||
} |
Oops, something went wrong.