Skip to content

Commit

Permalink
Refactor to use schemas and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhalos committed Feb 3, 2022
1 parent ddc70aa commit 44048a7
Show file tree
Hide file tree
Showing 44 changed files with 2,445 additions and 366 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Listener {

# TODOS

* Date and Times
* AsyncApi.Message
* @JsonIgnore
* Empty body
Expand Down
12 changes: 6 additions & 6 deletions docs/asyncapi-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ RabbitMQ Server

Description explaining exactly what happens here

#### Message lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage `<anonymous-message-1>`
#### Message lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage `lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage`

##### Payload

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | - | - | - | - | **additional properties are allowed** |
| amount | number | - | examples (`42.42`, `352.01`) | format (`float`) | - |
| currency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| currency | string | - | examples (`"EUR"`, `"USD"`, `"CHF"`) | - | - |

> Examples of payload _(generated)_
```json
{
"amount": 42.42,
"currency": "blah"
"currency": "EUR"
}
```

Expand All @@ -53,22 +53,22 @@ Description explaining exactly what happens here

Description explaining exactly what happens here

#### Message lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage `<anonymous-message-2>`
#### Message lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage `lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage`

##### Payload

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | - | - | - | - | **additional properties are allowed** |
| amount | number | - | examples (`42.42`, `352.01`) | format (`float`) | - |
| currency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| currency | integer | - | examples (`42`, `352`) | format (`int32`) | - |

> Examples of payload _(generated)_
```json
{
"amount": 42.42,
"currency": "blah"
"currency": 42
}
```

Expand Down
79 changes: 45 additions & 34 deletions docs/asyncapi-annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,50 @@ channels:
description: "Description explaining exactly what happens here"
subscribe:
message:
payload:
properties:
amount:
title: "amount"
examples:
- 42.42
- 352.01
type: "number"
format: "float"
currency:
title: "currency"
examples:
- 42
- 352
type: "integer"
format: "int32"
title: "lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage"
$ref: "#/components/messages/lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage"
publish:
message:
payload:
properties:
amount:
title: "amount"
examples:
- 42.42
- 352.01
type: "number"
format: "float"
currency:
title: "currency"
examples:
- "EUR"
- "USD"
- "CHF"
type: "string"
title: "lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage"
$ref: "#/components/messages/lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage"
components:
schemas:
java.lang.Integer-decfea64:
examples:
- 42
- 352
type: "integer"
format: "int32"
lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage:
title: "ExampleListenerMessage"
properties:
amount:
$ref: "#/components/schemas/java.math.BigDecimal-dbc8e12d"
currency:
$ref: "#/components/schemas/java.lang.String-931073f3"
java.lang.String-931073f3:
examples:
- "EUR"
- "USD"
- "CHF"
type: "string"
java.math.BigDecimal-dbc8e12d:
examples:
- 42.42
- 352.01
type: "number"
format: "float"
lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage:
title: "ExamplePublisherMessage"
properties:
amount:
$ref: "#/components/schemas/java.math.BigDecimal-dbc8e12d"
currency:
$ref: "#/components/schemas/java.lang.Integer-decfea64"
messages:
lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage:
payload:
$ref: "#/components/schemas/lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage"
title: "lu.greenhalos.j2asyncapi.annoations.example.listener.ExampleListener$ExampleListenerMessage"
lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage:
payload:
$ref: "#/components/schemas/lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage"
title: "lu.greenhalos.j2asyncapi.annoations.example.publisher.ExamplePublisher$ExamplePublisherMessage"
28 changes: 19 additions & 9 deletions docs/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,50 +27,60 @@ RabbitMQ Server

Publish information

#### Message lu.greenhalos.j2asyncapi.core.Example `<anonymous-message-1>`
#### Message lu.greenhalos.j2asyncapi.core.WriteToFileTest$Example `lu.greenhalos.j2asyncapi.core.WriteToFileTest$Example`

##### Payload

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | - | - | - | - | **additional properties are allowed** |
| floatingAmount | number | - | examples (`42.42`, `352.01`) | format (`float`) | - |
| bigDecimalAmount | number | - | examples (`42.42`, `352.01`) | format (`float`) | - |
| intAmount | integer | - | examples (`42`, `352`) | format (`int32`) | - |
| exampleEnum | string | - | allowed (`"VALUE_2"`, `"VALUE_3"`), examples (`"VALUE_2"`, `"VALUE_3"`) | - | - |
| intAmount | integer | - | examples (`"456565"`, `"4654"`) | format (`flapping`) | - |
| exampleLocalDateTime | string | - | examples (`"2022-01-31T23:20:50.52Z"`, `"1985-04-12T15:59:55-08:00"`) | format (`date-time`) | - |
| innerExample | - | - | - | - | **additional properties are allowed** |
| innerExample.innerCurrency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| innerExample.nestedInnerExample | - | - | - | - | **additional properties are allowed** |
| innerExample.nestedInnerExample.nestedInnerCurrency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| finalCurrency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| currency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| listCurrency | array<string> | - | - | - | - |
| listCurrency (single item) | string | - | examples (`"blah"`, `"blub"`) | - | - |
| privateFinalCurrency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| isFancy | boolean | - | examples (`true`, `false`) | - | - |
| doubleAmount | number | - | examples (`42.42`, `352.01`) | format (`double`) | - |
| exampleInstant | string | - | examples (`"2022-01-31T23:20:50.52Z"`, `"1985-04-12T15:59:55-08:00"`) | format (`date-time`) | - |
| floatingAmount | number | - | examples (`42.42`, `352.01`) | format (`float`) | - |
| bigDecimalAmount | number | - | examples (`42.42`, `352.01`) | format (`float`) | - |
| exampleLocalDate | string | - | examples (`"2022-01-31"`, `"1985-04-12"`) | format (`date`) | - |
| fieldAnnotation | integer | - | examples (`"456565"`, `"4654"`) | format (`flapping`) | - |
| currency | string | - | examples (`"blah"`, `"blub"`) | - | - |
| longAmount | integer | - | examples (`42`, `352`) | format (`int64`) | - |

> Examples of payload _(generated)_
```json
{
"floatingAmount": 42.42,
"bigDecimalAmount": 42.42,
"intAmount": 42,
"exampleEnum": "VALUE_2",
"intAmount": "456565",
"exampleLocalDateTime": "2022-01-31T23:20:50.52Z",
"innerExample": {
"innerCurrency": "blah",
"nestedInnerExample": {
"nestedInnerCurrency": "blah"
}
},
"finalCurrency": "blah",
"currency": "blah",
"listCurrency": [
"blah"
],
"privateFinalCurrency": "blah",
"isFancy": true,
"doubleAmount": 42.42,
"exampleInstant": "2022-01-31T23:20:50.52Z",
"floatingAmount": 42.42,
"bigDecimalAmount": 42.42,
"exampleLocalDate": "2022-01-31",
"fieldAnnotation": "456565",
"currency": "blah",
"longAmount": 42
}
```
Expand Down
Loading

0 comments on commit 44048a7

Please sign in to comment.