Skip to content

Commit

Permalink
feat(websockets bindings): v2 use common bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 21, 2024
1 parent e277f02 commit 9c5f5ac
Show file tree
Hide file tree
Showing 13 changed files with 851 additions and 755 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.asyncapi.v2.binding.channel.solace.SolaceChannelBinding;
import com.asyncapi.v2.binding.channel.sqs.SQSChannelBinding;
import com.asyncapi.v2.binding.channel.stomp.STOMPChannelBinding;
import com.asyncapi.v2.binding.channel.ws.WebSocketsChannelBinding;
import com.asyncapi.bindings.websockets.v0._1_0.channel.WebSocketsChannelBinding;
import com.asyncapi.v2.jackson.BindingsMapDeserializer;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.ObjectCodec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import com.asyncapi.v2._0_0.model.component.Components
import com.asyncapi.v2._0_0.model.info.Contact
import com.asyncapi.v2._0_0.model.info.Info
import com.asyncapi.v2._0_0.model.server.Server
import com.asyncapi.v2.binding.channel.ws.WebSocketsChannelBinding
import com.asyncapi.bindings.websockets.v0._1_0.channel.WebSocketsChannelBinding
import com.asyncapi.v2.schema.Schema
import com.asyncapi.v3.schema.AsyncAPISchema

class WebsocketGemini: AbstractExampleValidationTest() {

Expand Down Expand Up @@ -133,7 +134,7 @@ class WebsocketGemini: AbstractExampleValidationTest() {
"ws",
WebSocketsChannelBinding.builder()
.query(
Schema.builder()
AsyncAPISchema.builder()
.type("object")
.description(
"The semantics of entry type filtering is:\n" +
Expand All @@ -146,7 +147,7 @@ class WebsocketGemini: AbstractExampleValidationTest() {
.properties(mapOf(
Pair(
"heartbeat",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(false)
.description(
Expand All @@ -157,7 +158,7 @@ class WebsocketGemini: AbstractExampleValidationTest() {
),
Pair(
"top_of_book",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(false)
.description(
Expand All @@ -169,31 +170,31 @@ class WebsocketGemini: AbstractExampleValidationTest() {
),
Pair(
"bids",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include bids in change events")
.build()
),
Pair(
"offers",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include asks in change events")
.build()
),
Pair(
"trades",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include trade events")
.build()
),
Pair(
"auctions",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include auction events")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.asyncapi.examples.v2._6_0

import com.asyncapi.v2.Reference
import com.asyncapi.v2._6_0.model.ExternalDocumentation
import com.asyncapi.v2._6_0.model.channel.ChannelItem
import com.asyncapi.v2._6_0.model.channel.operation.Operation
import com.asyncapi.v2._6_0.model.channel.Parameter
Expand All @@ -11,8 +10,9 @@ import com.asyncapi.v2._6_0.model.component.Components
import com.asyncapi.v2._6_0.model.info.Info
import com.asyncapi.v2._6_0.model.info.Contact
import com.asyncapi.v2._6_0.model.server.Server
import com.asyncapi.v2.binding.channel.ws.WebSocketsChannelBinding
import com.asyncapi.bindings.websockets.v0._1_0.channel.WebSocketsChannelBinding
import com.asyncapi.v2.schema.Schema
import com.asyncapi.v3.schema.AsyncAPISchema

class WebsocketGemini: AbstractExampleValidationTest() {

Expand Down Expand Up @@ -135,7 +135,7 @@ class WebsocketGemini: AbstractExampleValidationTest() {
"ws",
WebSocketsChannelBinding.builder()
.query(
Schema.builder()
AsyncAPISchema.builder()
.type("object")
.description(
"The semantics of entry type filtering is:\n" +
Expand All @@ -148,7 +148,7 @@ class WebsocketGemini: AbstractExampleValidationTest() {
.properties(mapOf(
Pair(
"heartbeat",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(false)
.description(
Expand All @@ -159,7 +159,7 @@ class WebsocketGemini: AbstractExampleValidationTest() {
),
Pair(
"top_of_book",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(false)
.description(
Expand All @@ -171,31 +171,31 @@ class WebsocketGemini: AbstractExampleValidationTest() {
),
Pair(
"bids",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include bids in change events")
.build()
),
Pair(
"offers",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include asks in change events")
.build()
),
Pair(
"trades",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include trade events")
.build()
),
Pair(
"auctions",
Schema.builder()
AsyncAPISchema.builder()
.type("boolean")
.defaultValue(true)
.description("Include auction events")
Expand Down
Loading

0 comments on commit 9c5f5ac

Please sign in to comment.