Redocly/create-openapi-repo

display code samples when path has a parameter in it

coderbec opened this issue · 3 comments

I have a created a folder that is "v1@messages" which has a post.cs file in it for the csharp code sample, but when I put the get.cs file in there and try to build it produces the following error:

throw Error('Code sample for non-existing operation: "' + path + '",' + verb);

If I move it out of there into it's own folder it produces the same error. I have tried with this folder name:

"v1@messages@{messageId}"
and
"v1@messages@messageId"

What else should I try? Also, this should be updated in the readme for code samples.

Sorry, I didn't see this before.

We are releasing a new version soon where this will be moot.

However, what is the filename for the corresponding path?

bel0v commented

I'm getting the same error. I've created a new repo and following the cli steps added an existing spec.yaml and enabled the "splitting" setting. It split the file for me allright, with paths and components folders, but it cannot build or run due to this error ^
The definitions have links in them like this:

$ref: '#/components/schemas/Error'

after a bit of debugging I see that in the thrown error the path equals to '/echo' and the verb is 'post'. operation is undefined.
I haven't yet found out where those come from.

--
Okay, the problem was that there were code_samples generated. I deleted them and everything built.

Closing as stale. Feel free to reopen if this is still an issue.