-
Notifications
You must be signed in to change notification settings - Fork 5
Changelog
- added core annotations to specify schema 'type' and 'format':
@Schema
,@Type
. Can be added on classes and fields - exposes swagger library via gradle "api"
- swagger compilation step treats both openapi30
type
and openapi31types
as valid types - fixed bug: NPE during swagger compile inline step when using classes that have a nullable sealed class property
- added support for discriminator mapping in swagger schemas
- added support for example property on swagger
@Schema
-annotation (/~https://github.com/SMILEY4/schema-kenerator/pull/32) - added new core annotation
@Format
(/~https://github.com/SMILEY4/schema-kenerator/pull/36) - upgrade kotlin to 2.0.21
- fixed: naming conflict in core
@Default
annotation (/~https://github.com/SMILEY4/schema-kenerator/pull/35)
- fixed: swagger enum types were missing type "string"
- fixed bug: swagger schema now internally uses
types
(for openapi 3.1) instead oftype
(for openapi 3.0) for everything (/~https://github.com/SMILEY4/schema-kenerator/issues/28) - fixed bug: ignore default/unchanged values in swagger "Schema"-annotation (/~https://github.com/SMILEY4/schema-kenerator/pull/31)
- fixed bug: properly merge annotations on properties with annotations on types (/~https://github.com/SMILEY4/schema-kenerator/issues/27)
- fixed bug: nullpointer exception (/~https://github.com/SMILEY4/schema-kenerator/pull/26)
- fixed bug: (json-schema) properties with same types share modifications even though they should be applied to specific properties
- fix bug: wrong formatting with swagger TitleType/PathType "OPENAPI_FULL" and "OPENAPI_SIMPLE"
-
added step
renameProperties
to rename properties (including support for kotlinx-serialization JsonNamingStrategy) -
support for discriminators
-
addDiscriminatorProperty
-step to add discriminator property with specified name to all types with subtypes -
addJacksonTypeInfoDiscriminatorProperty
-step to add discriminator property with name specified by jackson JsonTypeInfo-annotation to all types with subtypes -
addJsonClassDiscriminatorProperty
-step to add discriminator property with name specified by kotlinx-serialization JsonClassDiscriminator-annotation to all types with subtypes - discriminator property is included in swagger schema-generation
-
-
add project schema-kenerator-validations with support for javax and jackarta validation annotation in swagger-schemas
- supported jakarta annotations:
- NotNull
- NotEmpty
- NotBlank
- Size
- Min
- Max
- supported javax annotations:
- NotNull
- NotEmpty
- NotBlank
- Size
- Min
- Max
- supported jakarta annotations:
-
annotations on constructor parameters are added to annotations of matching property
-
handle nullability of fields according to openapi 3.1.0, e.g. nullable string as
type: ["string", "null"]
-
fixed bug: required-annotation is ignored when all fields of a class would be nullable/optional
-
fixed bug: nullpointer-exception (see issue #22)
please ignore this version - i messed up during release here
- fix issues with nullability of fields
- fixed bug: wrong format for openapi TitleType and RefType
- fixed bug: wrong format for TitleType.OPENAPI_SIMPLE
- added
TitleType.OPENAPI_SIMPLE
,TitleType.OPENAPI_FULL
,RefType.OPENAPI_SIMPLE
,RefType.OPENAPI_FULL
as options for swagger that generate results confirming to the openapi-spec -
RefType.OPENAPI_FULL
replacesRefType.FULL
as the default for swagger schemas - renames step
withAutoTitle(...)
towithTitle(...)
- step
withTitle(...)
can take a builder function to provide a custom title - step
compileReferencing(...)
andcompileReferencingRoot(...)
can take a builder function to provide a custom path - fixed bug: redirecting to nullable types did not work correctly
- fixed bug: swagger example property not set correctly. Used examples instead of example.
- fixed bug: exception when using Schema-annotation with blank minimum and maximum
- fixed bug: Default-annotation not handled for properties (swagger and json-schema)
-
added steps
customizeTypes
andcustomizeProperties
for easier manual customization of json-schema and swagger-schema -
added support for optional properties
- detect optional parameters (non nullable, but with a default value provided)
- handle in schema generation step as required or non required (configurable)
-
added support for inline value classes
- detect value classes
- inline "wrapped" type in schema generation
-
added config option
knownNotParameterized
for type processing with kotlinx-serialization to manually prevent single type appearing multiple times in some setups -
added support for annotations with kotlinx-serialization
-
fixed: type redirects not working with kotlinx-serialization
-
fixed: exception when qualified name is missing, e.g. for local classes
- 🥳
- reworked naming of steps to be more consistent and clearer
- detect whether a collection allows only unique elements (i.e. is a set) and include uniqueItems in json and swagger schema generation
- implemented type redirects to allow processing a custom type instead of the real one
- fix: exception when filtering members of some types
- fix: exception when processing type parameters of some types
- merge annotations from kotlin property and java field to fix annotations not being able to be detected
- add support for Jackson annotations
@JsonPropertyDescription
@JsonIgnore
@JsonIgnoreType
@JsonIgnoreProperties
@JsonProperty
- add support for swagger annotations
@Schema
@ArraySchema
- add new step to merge getters with their properties
- added SchemaName annotation to "rename" types (qualified and simple name)
- added options to choose whether to use the name or the toString-function for enum constants
- fix type parameters missing for maps and collections
- fix schema reference paths
- improved dsl of custom processors
- fixed bug with typeId parser
- fixed build config
- initial version
- Installation
- Modules Overview
- Examples with Explanations
- General Concept
- Custom Type Processing
- Type Redirects
- Generating a Json-Schema using Reflection
- Generating a Swagger-schema using Kotlinx-Serialization
-
How To...
- ... add additional information like title and description to schemas?
- ... use 'toString' or 'name' for enum constants?
- ... overwrite specific types with custom data?
- ... give schemas a different name instead of using the name of the type?
- ... configure class property filters to include or exclude e.g. getter-functions, private or static fields?
- ... detect and handle subtypes and supertypes?
- Changelog