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

Read only fields are excluded from Webhook docs #2704

Closed
browniebroke opened this issue Sep 9, 2024 · 4 comments
Closed

Read only fields are excluded from Webhook docs #2704

browniebroke opened this issue Sep 9, 2024 · 4 comments
Labels
jira p/high t/bug Something isn't working triaged

Comments

@browniebroke
Copy link

Context

We're using stoplight elements to documents our webhooks, so the events we provide on our services that our clients can consume. The schema of the events sometimes contains read-only properties, but these are not visible in the payload of the webhook in the docs, despite being present in the schema.

Current Behavior

Given the following schema: https://gist.github.com/browniebroke/5b7c5be806ae36e95232768ff04cefd6

  schemas:
    Event:
      type: object
      properties:
        field_1:
          type: string
          readOnly: true
        field_2:
          type: string

Read only field_1 is not documented:

image

Expected Behavior

Expected to see a field_1 in the docs, above the field_2 property.

Possible Workaround/Solution

No workaround found yet, except switching to another theme.

Steps to Reproduce

See demo here: https://elements-demo.stoplight.io/?spec=https://gist.githubusercontent.com/browniebroke/5b7c5be806ae36e95232768ff04cefd6/raw/e7ae6de13d13f8f17b66aad743d35ff303600bcc/demo.yaml#/webhooks/Event-created/post

Sample schema: https://gist.github.com/browniebroke/5b7c5be806ae36e95232768ff04cefd6

Environment

  • Version used: 8.4.2
  • Environment name and version (e.g. Chrome 39, node.js 5.4): n/a
  • Operating System and version (desktop or mobile): Desktop and mobile
  • Link to your environment/workspace/project:
@mnaumanali94 mnaumanali94 added t/bug Something isn't working p/high labels Sep 9, 2024
@mnaumanali94
Copy link
Contributor

The behavior should be reversed for webhooks

Copy link

github-actions bot commented Sep 9, 2024

This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (PROVCON-2826) has been created.

@mnaumanali94
Copy link
Contributor

Fixed in #2718

@browniebroke
Copy link
Author

browniebroke commented Oct 10, 2024

I tried to look this up, but couldn't find the answer... Is it released? And if yes, which version?

Thanks for the fix!

EDIT: It's in 8.4.5 https://github.com/stoplightio/elements/pull/2718/files#diff-3f3e878b7d370469e5d51d51672ef4a13414d55cfdc00a8991f314454138e3afR3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira p/high t/bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants