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

fix: <binary> is not displaying in the docs #257

Merged

Conversation

SB-harshitajadhav
Copy link
Contributor

Motivation and Context

STOP-464

Description

Format is handled for contentMediaType type i.e. binary format

How Has This Been Tested?

Tested in local environment.

Screenshot(s)/recordings(s)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

@@ -3,6 +3,12 @@ import { RegularNode, SchemaNodeKind } from '@stoplight/json-schema-tree';
import { COMMON_JSON_SCHEMA_AND_OAS_FORMATS } from '../consts';

export function getApplicableFormats(schemaNode: RegularNode): [type: SchemaNodeKind, format: string] | null {
// Format is handled for contentMediaType type i.e. binary format
if (schemaNode.types !== null && schemaNode.fragment['contentMediaType'] === 'application/octet-stream') {
for (const type of schemaNode.types) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a loop here if its just going to return?

Copy link
Contributor Author

@SB-harshitajadhav SB-harshitajadhav May 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @daniel-white , I have updated the getApplicableFormat.ts , please review it once.

src/utils/getApplicableFormats.ts Outdated Show resolved Hide resolved
src/utils/getApplicableFormats.ts Show resolved Hide resolved
Copy link
Contributor

@EdVinyard EdVinyard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per our discussion, @SB-harshitajadhav will put this back in to the way she originally wrote it. Otherwise, it looks great!

@SB-harshitajadhav SB-harshitajadhav merged commit c30d690 into master May 10, 2024
1 check passed
@SB-harshitajadhav SB-harshitajadhav deleted the STOP-464-binary-is-not-displaying-in-the-docs branch May 10, 2024 13:03
@stoplight-bot
Copy link
Collaborator

🎉 This PR is included in version 4.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants