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

x-parser-schema-id getting rendered in html docs #15

Closed
InTheCloudDan opened this issue Apr 26, 2020 · 11 comments · Fixed by #166
Closed

x-parser-schema-id getting rendered in html docs #15

InTheCloudDan opened this issue Apr 26, 2020 · 11 comments · Fixed by #166
Labels
Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com

Comments

@InTheCloudDan
Copy link

Describe the bug

HTML Template example is getting rendered with x-parser-schema-id: null. The docs just render with the word x-parser-schema-id

How to Reproduce

streamHeaders:
      Etag:
        description: |
          The RFC7232 ETag header field in a response provides the current entity-
          tag for the selected resource. An entity-tag is an opaque identifier for
          different versions of a resource over time, regardless whether multiple
          versions are valid at the same time. An entity-tag consists of an opaque
          quoted string, possibly prefixed by a weakness indicator.
        example: 411a
      Cache-Control:
        description: The Cache-Control HTTP header holds directives (instructions) for caching in request.
        type: string
        example: no-cache, no-store, must-revalidate

under messages I have:

     headers:
        type: object
        properties:
          $ref: '#/components/schemas/streamHeaders'
  • Screenshots
    image

Expected behavior

That x-parser-schema-id doesn't render. Could definitely be user error but either way I don't think the internal metadata should be outputted.

@InTheCloudDan InTheCloudDan added the bug Something isn't working label Apr 26, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Jun 26, 2020
@kurrata
Copy link

kurrata commented Jul 10, 2020

I have the same issue.
When using playground meta information is added to html output when chaining references it seems
It can be seen in containerCreateResponse while containerCreateRequest doesn't have it

yaml file

asyncapi: 2.0.0
info:
  title: Test
  version: '1.0.0'

          
defaultContentType: application/json

channels:
  container/create:
    description: Create container
    publish:
      message:
        $ref: '#/components/messages/containerCreateRequest'
    subscribe:
      message:
        $ref: '#/components/messages/containerCreateResponse'
        
components:
  schemas:
    Container:
      id:
        type: id
      barcode:
        type: string
        
    BaseRequest:
      action:
        type: string
        description: "Requested action name. Generally it is in <controller>/<action> format"
      uuid:
        type: string
        description: "UUID number used to match request with responses if nececary"
      payload:
        oneOf:
          - type: array
            description: "Request payload"
          - type: None
        
    BaseResponse:
      action:
        type: string
        description: "Requested action name. Generally it is in <controller>/<action> format"
      code:
        type: integer
        description: "Actions response code. It mostly follows http status codes"
        enum:
          - 200
          - 400 
          - 401
          - 403
          - 500
      uuid:
        type: string
        description: "UUID number used to match request with responses if nececary"
      payload:
        oneOf:
          - type: array
            description: "Response payload"
          - type: None
          
  messages:
    containerCreateRequest:
      payload:
        type: object
        required:
        - action
        properties:
          $ref: "#/components/schemas/BaseRequest"
          payload:
            type: object
            properties:
              sender_unit:
                type: string
                description: Unit's id or fcd code
              addressee_unit:
                type: string
                description: Unit's id or fcd code
              consignment_type:
                type: string
                description: containers consignment id or label
              source_id:
                type: integer
                description: System id 

              
            
    containerCreateResponse:
      payload:
        type: object
        required:
        - action
        - code
        properties:
          $ref: "#/components/schemas/BaseResponse"
          payload:
            type: object
            properties:
              $ref: "#/components/schemas/Container"

Generated bad section

{
  "payload": {
    "id": null,
    "barcode": "string",
    "x-parser-schema-id": null
  },
  "action": "string",
  "code": 200,
  "uuid": "string"
}

@derberg derberg removed bug Something isn't working stale labels Aug 10, 2020
@derberg derberg reopened this Aug 10, 2020
@derberg
Copy link
Member

derberg commented Aug 10, 2020

x-parser-schema-id is added by the parser to every schema that has no schema id and it is needed purely for code generation. I totally agree it should not be rendered in docs. Is anyone interested in contributing this functionality? I can help pointing out where it needs to be done.

@derberg
Copy link
Member

derberg commented Sep 22, 2020

we need to have the proper condition here to not render any property that starts with x-parser

@derberg derberg added the Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com label Oct 1, 2020
@derberg
Copy link
Member

derberg commented Oct 1, 2020

video explanation on how to work on this issue https://youtu.be/Iqs_2BiNEEo?t=329

@github-actions
Copy link

github-actions bot commented Dec 1, 2020

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Dec 1, 2020
@derberg derberg removed the stale label Dec 1, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Jan 31, 2021
@github-actions github-actions bot closed this as completed Apr 1, 2021
@derberg derberg removed the stale label Apr 1, 2021
@derberg
Copy link
Member

derberg commented Apr 1, 2021

@magicmatatjahu yo, I'm not sure if I should reopen this one, how does it look like in react component?

@magicmatatjahu
Copy link
Member

@derberg Generation for examples are not yet rewritten for the "new" component. I will reopen it and I remember about this issue to check and fix in component :)

@magicmatatjahu
Copy link
Member

It will be fixed in #166

@magicmatatjahu
Copy link
Member

Fixed in @asyncapi/html-template@0.21.0 @InTheCloudDan Reopen if will you found bugs, and sorry for delay 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants