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

Kafka security schemes invalid specification #171

Open
ch-ti8m-michalpenka opened this issue Aug 23, 2023 · 0 comments
Open

Kafka security schemes invalid specification #171

ch-ti8m-michalpenka opened this issue Aug 23, 2023 · 0 comments

Comments

@ch-ti8m-michalpenka
Copy link

I'm trying to render the following async api:

asyncapi: 2.2.0
info:
  title: My Kafka topic
  version: 1.0.0
servers:
  demo:
    url: myclester.org:8092
    protocol: kafka-secure
    security:
      - mysecurity
components:
  securitySchemes:
    mysecurity:
        type: X509

I try to add a security scheme to components like below in a document filter:


            document.Components.SecuritySchemes.Add(
                new KeyValuePair<string, SecurityScheme>(
                    "mysecurity",
                    new SecurityScheme(SecuritySchemeType.X509)));

When I try to render the html, I get the following output on the page itself:

Error: There were errors validating the AsyncAPI document.
88./components/securitySchemes/mysecurity should have required property '$ref'
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
92./components/securitySchemes/mysecurity/in should be string
92./components/securitySchemes/mysecurity/in should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity/scheme should be string
90./components/securitySchemes/mysecurity/description should be string
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity/scheme should be string
93./components/securitySchemes/mysecurity/scheme should be equal to one of the allowed values
94./components/securitySchemes/mysecurity/bearerFormat should be string
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
91./components/securitySchemes/mysecurity/name should be string
92./components/securitySchemes/mysecurity/in should be string
92./components/securitySchemes/mysecurity/in should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
88./components/securitySchemes/mysecurity should match exactly one schema in oneOf
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
95./components/securitySchemes/mysecurity/flows should be object
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
96./components/securitySchemes/mysecurity/openIdConnectUrl should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
91./components/securitySchemes/mysecurity should NOT have additional properties
92./components/securitySchemes/mysecurity should NOT have additional properties
93./components/securitySchemes/mysecurity should NOT have additional properties
94./components/securitySchemes/mysecurity should NOT have additional properties
95./components/securitySchemes/mysecurity should NOT have additional properties
96./components/securitySchemes/mysecurity should NOT have additional properties
89./components/securitySchemes/mysecurity/type should be equal to one of the allowed values
90./components/securitySchemes/mysecurity/description should be string
88./components/securitySchemes/mysecurity should match exactly one schema in oneOf
88./components/securitySchemes/mysecurity should match exactly one schema in oneOf
88./components/securitySchemes/mysecurity should match exactly one schema in oneOf

I believe it is because the json contains the following (I believe it is due to wrong serialization, ignorenull should be used):


    "securitySchemes": {
      "mysecurity": {
        "type": "X509",
        "description": null,
        "name": null,
        "in": null,
        "scheme": null,
        "bearerFormat": null,
        "flows": null,
        "openIdConnectUrl": null
      }
    }

But even then, if this would render correct json, how do I then reference my security scheme component in the server via code?

Thanks for fixing/advising.

@ch-ti8m-michalpenka ch-ti8m-michalpenka changed the title Kafka security schemes bug Kafka security schemes invalid specification Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant