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

feat: 1.0.0-EAP-3 #188

Merged
merged 25 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
52bd5d0
test(2.6.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 28, 2024
6dc4ffe
test(2.6.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 28, 2024
604c425
test(2.6.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 28, 2024
4d3f011
test(2.6.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
9bac326
fix(2.6.0): check correctness of realisation by reading AsyncAPI exam…
Pakisan Feb 29, 2024
46f9cac
fix(2.6.0): check correctness of realisation by reading AsyncAPI exam…
Pakisan Feb 29, 2024
1f59be4
fix(2.6.0): check correctness of realisation by reading AsyncAPI exam…
Pakisan Feb 29, 2024
3592425
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
a190ac5
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
307666e
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
e113d46
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
1767c7f
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
d14251a
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
2c0985e
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
7207db1
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
01a250b
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
414a339
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
6995354
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
10e5a22
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
4e4af48
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Feb 29, 2024
adcbdda
test(2.0.0): check correctness of realisation by reading AsyncAPI exa…
Pakisan Mar 10, 2024
54dfff2
docs: CHANGELOG.md
Pakisan Mar 10, 2024
0fb4c9d
docs: kudos for 1.0.0-EAP-3
Pakisan Mar 10, 2024
0819fec
docs: add 2.0.0 Schema.multipleOf change
Pakisan Mar 10, 2024
3e904ec
build: 1.0.0-EAP-3
Pakisan Mar 10, 2024
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
156 changes: 156 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0-EAP-3] - 2024-03-10

Kudos to:
- https://github.com/jaydeepk
- https://github.com/ctasada
- https://github.com/guillaumelamirand
- https://github.com/ivanalayan15
- https://github.com/Crain-32
- https://github.com/wrwks
- https://github.com/dennis-brinley

### Added

- AsyncAPI 3.0.0

### Changed

- Reference was moved from `com.asyncapi.v2._6_0.model` to `com.asyncapi.v2`
- 2.0.0:
- `Schema.multipleOf` type was changed to `Number`
- 2.6.0:
- Specification:
- `AsyncAPI.servers` now can hold server objects and references
- `AsyncAPI.info` now has default value - empty Info object
- `AsyncAPI.channels` now has default value - empty map
- `Info.title` now has default value - empty string
- `Info.version` now has default value - empty string
- `License.name` now has default value - empty string
- `Server.url` now has default value - empty string
- `Server.protocol` now has default value - empty string
- `Tag.name` now has default value - empty string
- `CorrelationId.location` now has default value - empty string
- `OneOfMessages.oneOf` now has default value - empty list
- Bindings:
- AMQP:
- `AMQPChannelBinding.is` now `is required` and type was changed from `string` to `AMQPChannelType` enum and has default value - `routingKey`
- AMQP `ExchangeProperties` was extracted and renamed to `AMQPChannelExchangeProperties`
- AMQP `QueueProperties` was extracted and renamed to `AMQPChannelQueueProperties`
- Anypoint MQ:
- `AnypointMQChannelBinding.destinationType` was changed from `string` to `AnypointMQChannelDestinationType` with next default value - `queue`
- Google Pub/Sub:
- channels:
- `GooglePubSubChannelBinding.topic` now has default value - empty string
- `GooglePubSubChannelBinding.messageStoragePolicy` was extracted and renamed to `GooglePubSubChannelMessageStoragePolicy`
- `GooglePubSubChannelBinding.schemaSettings` was extracted and renamed to `GooglePubSubChannelSchemaSettings`
- `GooglePubSubChannelBinding.schemaSettings` now has default value - `GooglePubSubChannelSchemaSettings()`
- messages:
- `GooglePubSubMessageBinding.schema` was extracted and renamed to `GooglePubSubMessageSchemaDefinition`
- IBM MQ:
- channels:
- `IBMMQChannelBinding.destinationType` type was changed to `IBMMQChannelDestinationType`
- `IBMMQChannelBinding.destinationType` now has default value - `topic`
- `IBMMQChannelBinding.queue` was extracted and renamed to `IBMMQChannelQueueProperties`
- `IBMMQChannelBinding.topic` was extracted and renamed to `IBMMQChannelTopicProperties`
- `IBMMQChannelBinding.topic` was extracted and renamed to `IBMMQChannelTopicProperties`
- messages:
- `IBMMQMessageBinding.type` type was changed to `IBMMQMessageType`
- `IBMMQMessageBinding.type` now has default value - `string`
- `IBMMQMessageBinding.expiry` now has default value - `0`
- Kafka:
- channels:
- `KafkaChannelBinding.topicConfiguration` was extracted and renamed to `KafkaChannelTopicConfiguration`
- messages:
- `KafkaMessageBinding.key` type was changed to `Schema`
- `KafkaMessageBinding.schemaIdLocation` type was changed to `KafkaMessageSchemaIdLocation`
- operations:
- `KafkaOperationBinding.groupId` type was changed to `Schema`
- `KafkaOperationBinding.clientId` type was changed to `Schema`
- Pulsar:
- `PulsarChannelBinding.namespace` now has default value - empty string
- `PulsarChannelBinding.persistence` type was changed to `PulsarChannelPersistence`
- `PulsarChannelBinding.persistence` now has default value - `persistent`
- `PulsarChannelBinding.retention` was extracted and renamed to `PulsarChannelRetentionDefinition`
- WebSocket:
- `WebSocketsChannelBinding.method` type was changed to `WebSocketsChannelMethod`
- `WebSocketsChannelBinding.query` type was changed to `Schema`
- `WebSocketsChannelBinding.headers` type was changed to `Schema`
- Anypoint MQ:
- `AnypointMQMessageBinding.headers` type was changed to `Schema`
- HTTP:
- messages:
- `HTTPMessageBinding.headers` type was changed to `Schema`
- operations:
- `HTTPOperationBinding.type` type was changed to `HTTPOperationType`
- `HTTPOperationBinding.type` now has default value - `request`
- `HTTPOperationBinding.method` type was changed to `HTTPOperationMethod`
- `HTTPOperationBinding.query` type was changed to `Schema`
- Solace:
- operations:
- `SolaceOperationBinding.destinations` type was changed to `List<SolaceOperationDestination>`
- `SolaceDestination` was extracted end renamed to `SolaceOperationDestination`
- `SolaceQueue` was renamed to `SolaceOperationQueue`
- `SolaceTopic` was renamed to `SolaceOperationTopic`
- MQTT:
- servers:
- `LastWillConfiguration` was renamed to `MQTTServerLastWillConfiguration`

### Fixed

- Compiling warnings - https://github.com/asyncapi/jasyncapi/pull/152
- Array schema is not being parsed correctly - https://github.com/asyncapi/jasyncapi/pull/159

## [1.0.0-EAP-2] - 2023-03-16

https://github.com/asyncapi/jasyncapi/pull/137

### Added

- AsyncAPI 2.6.0
- New Bindings
- New Security Schemes
- Specification components now can be extended with `x-*`

### Changed

- Bindings now are common for `2.6.0` and `2.0.0`
- Schema now is common for `2.6.0` and `2.0.0`
- Security Scheme now is common for `2.6.0` and `2.0.0`
- `Schema.additionalProperties` now can be `boolean` or `Schema`
- Schema.minimum, Schema.exclusiveMinimum, Schema.maximum, Schema.exclusiveMaximum now are BigDecimal:
- https://github.com/asyncapi/jasyncapi/issues/97
- https://github.com/asyncapi/jasyncapi/issues/96

### Fixed

- Specification components doesn't overrides given ObjectMapper - https://github.com/asyncapi/jasyncapi/issues/128
- 2.0.0 - typo in Components serverBindings: ServerBinding instead of ServerBindingsDeserializer
- 2.0.0 - fixed typo in ServerVariable field name - example was renamed to examples
- Error while parsing of specifications when Reference was recognized as Schema

## [1.0.0-EAP-1] - 2021-03-08

https://github.com/asyncapi/jasyncapi/pull/35

### Changed

- `com.asyncapi.v2.schema.Schema` field `enumValues` was renamed to `enumValue`
- `com.asyncapi.v2.model.schema.Type` was changed to class
- Updated description of `examples` for `com.asyncapi.v2.model.channel.message.Message`

## [1.0.0-EAP] - 2021-02-08

Initial release of AsyncAPI 2.0.0

https://github.com/asyncapi/jasyncapi/pull/31

### Added

- AsyncAPI 2.0.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
> ⚠️ This project doesn't support AsyncAPI 1.x
---

[![Version](https://img.shields.io/maven-central/v/com.asyncapi/asyncapi-core?logo=apache-maven)](https://search.maven.org/artifact/io.quarkiverse.asyncapi/quarkus-asyncapi)
[![Version](https://img.shields.io/maven-central/v/com.asyncapi/asyncapi-core?logo=apache-maven)](https://central.sonatype.com/artifact/com.asyncapi/asyncapi-core/1.0.0-EAP-3)

## Overview
JVM-friendly bindings for AsyncAPI. It allows you to read or write specifications for your asynchronous API through code
Expand Down
2 changes: 1 addition & 1 deletion asyncapi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>asyncapi</artifactId>
<groupId>com.asyncapi</groupId>
<version>1.0.0-EAP-3-SNAPSHOT</version>
<version>1.0.0-EAP-3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ Validation Keywords for Numeric Instances (number and integer)
*/
@Nullable
@JsonProperty
public Integer multipleOf;
public Number multipleOf;

/**
* The value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package com.asyncapi.examples.v2._0_0

import com.asyncapi.v3.ClasspathUtils
import com.asyncapi.v2._0_0.model.AsyncAPI
import com.asyncapi.v2._0_0.model.component.Components
import com.asyncapi.v2._0_0.model.info.Info
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

abstract class AbstractExampleValidationTest {

private val objectMapper = ObjectMapper(YAMLFactory())
.setSerializationInclusion(JsonInclude.Include.NON_NULL)

abstract fun specificationLocation(): String

private fun specification(): AsyncAPI {
return objectMapper.readValue(
ClasspathUtils.readAsString(specificationLocation()),
AsyncAPI::class.java
)
}

open fun expectedId(): String? = null

@Test
fun `ensure that id was read correctly`() {
Assertions.assertEquals(
specification().id,
expectedId(),
"id must be read correctly"
)
}

open fun expectedDefaultContentType(): String? = null

@Test
fun `ensure that defaultContentType was read correctly`() {
Assertions.assertEquals(
specification().defaultContentType,
expectedDefaultContentType(),
"defaultContentType must be read correctly"
)
}

abstract fun expectedInfo(): Info

@Test
fun `ensure that info was read correctly`() {
Assertions.assertEquals(
specification().info,
expectedInfo(),
"Info must be read correctly"
)
}

abstract fun expectedServers(): Map<String, Any>?

@Test
fun `ensure that servers were read correctly`() {
Assertions.assertEquals(
specification().servers,
expectedServers(),
"Servers must be read correctly"
)
}

abstract fun expectedChannels(): Map<String, Any>

@Test
fun `ensure that channels were read correctly`() {
Assertions.assertEquals(
specification().channels,
expectedChannels(),
"Channels must be read correctly"
)
}

abstract fun expectedComponents(): Components?

@Test
fun `ensure that components were read correctly`() {
Assertions.assertEquals(
specification().components,
expectedComponents(),
"Components must be read correctly"
)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package com.asyncapi.examples.v2._0_0

import com.asyncapi.v2.Reference
import com.asyncapi.v2._0_0.model.channel.ChannelItem
import com.asyncapi.v2._0_0.model.channel.message.Message
import com.asyncapi.v2._0_0.model.channel.operation.Operation
import com.asyncapi.v2._0_0.model.component.Components
import com.asyncapi.v2._0_0.model.info.Info
import com.asyncapi.v2.schema.Schema

class AnyOf: AbstractExampleValidationTest() {

override fun specificationLocation(): String = "/examples/v2.0.0/anyof.yml"

override fun expectedInfo(): Info {
return Info.builder()
.title("AnyOf example")
.version("1.0.0")
.build()
}

override fun expectedServers(): Map<String, Any>? = null

override fun expectedChannels(): Map<String, Any> {
return mapOf(
Pair("test", ChannelItem.builder()
.publish(Operation.builder()
.message(Reference("#/components/messages/testMessages"))
.build()
)
.build()
)
)
}

override fun expectedComponents(): Components? {
return Components.builder()
.messages(mapOf(
Pair("testMessages", Message.builder()
.payload(Schema.builder()
.anyOf(listOf(
Schema.builder().ref("#/components/schemas/objectWithKey").build(),
Schema.builder().ref("#/components/schemas/objectWithKey2").build(),
))
.build()
)
.build()
)
))
.schemas(mapOf(
Pair("objectWithKey", Schema.builder()
.type("object")
.properties(mapOf(
Pair("key", Schema.builder()
.type("string")
.additionalProperties(false)
.build()
)
))
.build()
),
Pair("objectWithKey2", Schema.builder()
.type("object")
.properties(mapOf(
Pair("key2", Schema.builder()
.type("string")
.build()
)
))
.build()
)
))
.build()
}

}
Loading
Loading