Skip to content

Commit

Permalink
feat: #782 adding test resources
Browse files Browse the repository at this point in the history
  • Loading branch information
lbroudoux committed Apr 12, 2023
1 parent cba6ef3 commit 31ccfd4
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
asyncapi: '2.4.0'
id: 'urn:io.microcks.example.user-signedup'
info:
title: User signed-up API
version: 0.1.0
description: Sample AsyncAPI for user signedup events
contact:
name: Laurent Broudoux
url: https://github.com/lbroudoux
email: laurent.broudoux@gmail.com
license:
name: MIT License
url: https://opensource.org/licenses/MIT
defaultContentType: application/json
channels:
user/signedup:
description: The topic on which user signed up events may be consumed
subscribe:
summary: Receive informations about user signed up
operationId: receivedUserSIgnedUp
message:
description: An event describing that a user just signed up.
bindings:
kafka:
key:
type: string
description: Timestamp of event as milliseconds since 1st Jan 1970
traits:
- $ref: '#/components/messageTraits/commonHeaders'
headers:
type: object
properties:
sentAt:
type: string
format: date-time
description: Date and time when the event was sent
payload:
$ref: '#/components/schemas/UserSignedupEvent'
examples:
- laurent:
summary: Example for Laurent user
headers: |-
{"my-app-header": 23, "sentAt": "2020-03-11T08:03:28Z"}
payload: |-
{"fullName": "Laurent Broudoux", "email": "laurent@microcks.io", "age": 41}
- john:
summary: Example for John Doe user
headers:
my-app-header: 24
sentAt: "2020-03-11T08:03:38Z"
payload:
fullName: John Doe
email: john@microcks.io
age: 36
components:
schemas:
UserSignedupEvent:
type: object
allOf:
- $ref: "./user-signedup.json"
messageTraits:
commonHeaders:
headers:
type: object
properties:
my-app-header:
type: integer
minimum: 0
maximum: 100
examples:
laurent:
my-app-header: 21
yacine:
my-app-header: 22
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "UserSignedupEvent Specification JSON Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"fullName": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"age": {
"type": "integer",
"minimum": 18
}
}
}



0 comments on commit 31ccfd4

Please sign in to comment.