elements icon indicating copy to clipboard operation
elements copied to clipboard

Investigate if we allow to pass incorrect http operation data to Request Samples

Open mmiask opened this issue 4 years ago • 0 comments

Summary

Story

When working on https://github.com/stoplightio/elements/pull/1687 I wanted to add a test. In Elements, I opened a project that had a big response example (Public APIs/Bitbucket API/Get a respository diffstat). Using React dev tools I extracted httpOperation from ResponseExamples component. This httpOperation is expected to be of type IHttpOperation.

When I pasted the value to VSCode though as following:

import { IHttpOperation } from '@stoplight/types';

export const httpOperation: IHttpOperation =
{
here goes the httpOperation value extracted using devtools
}

I started getting type errors: Screen Shot 2021-08-13 at 6 31 20 PM

Because of that, the response examples is not generated properly. At the same time, the response schema itself is rendered properly in Docs.

Tasks

  • [ ] Find the source of a problem. Possible: http-spec, Elements typings?, Elements function for generating response examples
  • [ ] Code the fix

mmiask avatar Aug 13 '21 16:08 mmiask