stoplightio / json-schema-viewer

A JSON Schema viewer React component
Apache License 2.0
175 stars 37 forks source link

feat(error-check): add check for error message #198

Closed brendarearden closed 2 years ago

brendarearden commented 2 years ago

Motivation and Context

When users are viewing public endpoints that reference internally marked schemas, we need a way to display an error message to let the user know they do not have permissions to view it.

InsertIssueNumberHere

https://github.com/stoplightio/platform-internal/issues/10534

Description

Added a check at the toplevelschemarow and at the schemarow levels to check for the x-sl-error-message property

How Has This Been Tested?

Manually tested changes by pulling this package into platform internal and manually making changes to the schema and schema permissions and seeing if the error message showed up as expected.

Added test coverage for SchemaRow

Screenshot(s)/recordings(s)

Screen Shot 2022-06-02 at 9 46 40 AM

Types of changes

Checklist

stoplight-bot commented 2 years ago

:tada: This PR is included in version 4.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: