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

Create an initial version of the JSON schema processors #8

Merged
merged 42 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9dee537
Create an initial version of the JSON schema processors
andriy-dmytruk Apr 3, 2024
4e82221
add dependencies
sdelamo Apr 4, 2024
208e650
add tests
sdelamo Apr 4, 2024
af4b9e6
Update versions
andriy-dmytruk Apr 4, 2024
428a79f
doc: move relaese history to the end
sdelamo Apr 5, 2024
00c99b7
split docs
sdelamo Apr 5, 2024
a23be19
remove unused modules
sdelamo Apr 5, 2024
a8f3501
show generate file in the docs
sdelamo Apr 5, 2024
1f1ad5d
remove print input
sdelamo Apr 5, 2024
1011778
Merge pull request #9 from micronaut-projects/remove-print
andriy-dmytruk Apr 5, 2024
61bfacd
use id(“”) syntax to apply Gradle plugin
sdelamo Apr 8, 2024
1b25d00
remove maxHeapSize configuration
sdelamo Apr 8, 2024
5f4d32e
remove logback unncessary configuration
sdelamo Apr 8, 2024
8479391
remove empty dependencies block
sdelamo Apr 8, 2024
cfebf6c
Merge pull request #13 from micronaut-projects/remove-empty-dependenc…
andriy-dmytruk Apr 8, 2024
95aa553
Merge pull request #12 from micronaut-projects/remove-logback-config
andriy-dmytruk Apr 8, 2024
5d8ed10
Merge branch 'andriy/init' into remove-max-heap-size
andriy-dmytruk Apr 8, 2024
77e3df9
Merge pull request #11 from micronaut-projects/remove-max-heap-size
andriy-dmytruk Apr 8, 2024
cfa3747
Merge pull request #10 from micronaut-projects/use-id-double-quote
andriy-dmytruk Apr 8, 2024
92af672
fix docs
sdelamo Apr 9, 2024
f0f7d4f
remove controller
sdelamo Apr 9, 2024
1e5f546
add logback
sdelamo Apr 9, 2024
06706fa
suffix schema.json in id
sdelamo Apr 9, 2024
3a2af09
Merge pull request #15 from micronaut-projects/add-logback
andriy-dmytruk Apr 9, 2024
02a633c
Merge pull request #16 from micronaut-projects/init-id-schema-json
andriy-dmytruk Apr 9, 2024
b014c4f
Merge pull request #14 from micronaut-projects/remove-controller
andriy-dmytruk Apr 9, 2024
02ce616
annotate processor classes with @Internal
sdelamo Apr 10, 2024
9280bf2
use kotlin file
sdelamo Apr 10, 2024
98bba9e
JSON Schema Validation
sdelamo Apr 10, 2024
b2a9c2a
Merge pull request #18 from micronaut-projects/use-kotlin-file
andriy-dmytruk Apr 10, 2024
646916c
Merge pull request #19 from micronaut-projects/validator
andriy-dmytruk Apr 10, 2024
97483a5
Merge pull request #17 from micronaut-projects/annotate-with-internal
andriy-dmytruk Apr 10, 2024
4166e72
Add possibility to support multiple drafts in the future (#20)
andriy-dmytruk Apr 11, 2024
ea8f7cd
Implement review comments
andriy-dmytruk Apr 11, 2024
ea2c052
Extend Jackson support and add tests (#21)
andriy-dmytruk Apr 12, 2024
231b41e
Remove the JsonSchemaConfiguration in favor of changing the annotatio…
andriy-dmytruk Apr 16, 2024
bd1d8d0
Change visitor type to isolating
andriy-dmytruk Apr 16, 2024
ae9e774
Add back documentation changes
andriy-dmytruk Apr 16, 2024
7b6784b
Modify the JSON schema validator to not use mappings and only allow l…
andriy-dmytruk Apr 16, 2024
9978b6a
Modify annotation support and provide warnings for unsupported annota…
andriy-dmytruk Apr 18, 2024
48ac454
Fix tests
andriy-dmytruk Apr 18, 2024
25c8f87
Fix spotless
andriy-dmytruk Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/docs/guide/sources.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Information for JSON schema is aggregated from multiple sources.



### Jackson annotations
andriy-dmytruk marked this conversation as resolved.
Show resolved Hide resolved


45 changes: 45 additions & 0 deletions src/main/docs/guide/sources/jacksonAnnotations.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
The following `com.fasterxml.jackson.annotation` annotations are supported:

[cols="2", options="header"]
|===
| Jackson Annotations | Supported
| `JsonClassDescription` | ✅
| `JsonIgnore` | ✅
| `JsonIgnoreProperties` | ✅
| `JsonInclude` | ✅
| `JsonIncludeProperties` | ✅
| `JsonProperty` | ✅
| `JsonPropertyDescription` | ✅
| `JsonSubTypes` | ✅
| `JsonTypeInfo` | ✅
| `JsonTypeName` | ✅
| `JsonUnwrapped` | ✅
| `JsonAlias` | ❌
| `JsonAnyGetter` | ❌
| `JsonAnySetter` | ❌
| `JsonAutoDetect` | ❌
| `JsonBackReference` | ❌
| `JsonCreator` | ❌
| `JsonEnumDefaultValue` | ❌
| `JsonFormat` | ❌
| `JsonGetter` | ❌
| `JsonIdentityInfo` | ❌
| `JsonIdentityReference` | ❌
| `JsonIgnoreType` | ❌
| `JsonKey` | ❌
| `JsonManagedReference` | ❌
| `JsonMerge` | ❌
| `JsonRawValue` | ❌
| `JsonRootName` | ❌
| `JsonSetter` | ❌
| `JsonTypeId` | ❌
| `JsonValue` | ❌
| `JsonView` | ❌
| `JacksonInject` | ❌
| `JsonFilter` | ❌
| `JsonPropertyOrder` | ❌
|===

NOTE: Custom serializers and deserializers cannot be supported, as this information is implementation-specific
and not available during build time. This also applies to some other features, like the `JsonFilter` annotation
which allows defining custom filters.
2 changes: 2 additions & 0 deletions src/main/docs/guide/sources/javadoc.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
JavaDoc on types and properties will be added to the description properties of schemas. This includes class, property
descriptions and record parameter descriptions.
34 changes: 34 additions & 0 deletions src/main/docs/guide/sources/validationAnnotations.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
The following `jakarta.validation.constraints` annotations are supported:

[cols="2", options="header"]
|===
| Validation Annotations | Supported
| `AssertFalse` | ✅
| `AssertTrue` | ✅
| `DecimalMin` | ✅
| `DecimalMax` | ✅
| `Email` | ✅
| `Max` | ✅
| `Min` | ✅
| `Negative` | ✅
| `NegativeOrZero` | ✅
| `NotBlank` | ✅
| `NotEmpty` | ✅
| `NotNull` | ✅
| `Null` | ✅
| `Pattern` | ✅
| `Positive` | ✅
| `PositiveOrZero` | ✅
| `Size` | ✅
| `Digits` | ❌
| `Future` | ❌
| `FutureOrPresent` | ❌
| `Past` | ❌
| `PastOrPresent` | ❌
|===

By default, properties are not nullable. `jakarta.annotations.Nullable` can be added to make them nullable.
Note, that validation might not correspond to actual bean values, as by default null
values are completely omitted during JSON serialization.

NOTE: Custom validators cannot be supported, as this information is implementation-specific and not available during build time.
36 changes: 0 additions & 36 deletions src/main/docs/guide/supported-features.adoc

This file was deleted.

5 changes: 4 additions & 1 deletion src/main/docs/guide/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ quickStart:
title: Quick Start
configuration:
title: Configuration
supported-features:
sources:
title: Supported Information Sources
javadoc: JavaDoc
validationAnnotations: Validation Annotations
jacksonAnnotations: Jackson Annotations
serving:
title: Serving JSON Schemas
repository: Repository
Expand Down