-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added Required to the Schema for rendering. #3
Conversation
I'm going to reopen the PR because of CI |
ac6b84e
to
23b664b
Compare
There is an issue in asyncapi CLI tool that does not exit code 1 when schema is invalid - asyncapi/cli#1068 Yet, if you look into the pipeline https://github.com/Ferror/asyncapi-doc-bundle/actions/runs/7544841545/job/20539100621?pr=3 you will notice errors. Mostly because the asyncapi: 2.6.0
info:
title: 'Service Example API'
version: 1.2.3
description: 'This service is in charge of processing user signups'
servers:
production:
url: broker.mycompany.com
protocol: amqp
description: 'This is production broker.'
staging:
url: broker.mycompany.com
protocol: amqp
description: 'This is staging broker.'
channels:
product.created:
subscribe:
message:
$ref: '#/components/messages/ProductCreated'
components:
messages:
ProductCreated:
payload:
type: object
properties:
id:
type: integer
description: ''
amount:
type: number
description: ''
currency:
type: string
description: ''
isPaid:
type: boolean
description: ''
createdAt:
type: string
description: ''
format: date-time
week:
type: integer
description: ''
payment:
type: string
description: ''
products:
type: string
description: ''
tags:
type: string
description: ''
required:
- id
- currency
- isPaid
|
So you are right about the issue, but the solution still needs to be there. Let me know if you would like to continue on this PR or I can provide fix for it 😄 |
Yep. My mistake. I actually fixed this on my local generator or EventCatalog but completely forgot to come back to fix it here. 😂 happy to apply the fix if you haven't already. Had myself convinced it was required on the property and not an array of required properties. 🤦 |
@robert-sykes go ahead. FYI. I'm starting slowly to build similar library for Java/Spring if you are interested 😄 |
Ah - i'm afraid I don't know much about Java/Spring to be of any help. 😄 |
@Ferror I think the following line: "required": {
"0": "name",
"1": "email",
"2": "age",
"3": "isCitizen"
} and is causing the validation error we are seeing in the actions. I am not sure how get around this at the moment, only once test seems to fail if we remove the I've made the change and pushed the fix anyway to check that the Actions are working for now. |
@robert-sykes I will accept the PR and create issue to look into JSON Generator. It is durable, but I think we will need to hack a little bit ;p |
The
Required
option does not seem to be rendering for a property. I am not sure if this is intentional or not. This PR adds the support for it to be rendered out withrequired
being defaulted to true. This allowsrequired
properties to be marked as such.