-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(specs): add cURL snippets #3841
Conversation
✔️ Code generated!
📊 Benchmark resultsBenchmarks performed on the method using a mock server, the results might not reflect the real-world performance.
|
5093e16
to
65be943
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great !
@@ -1,9 +1,11 @@ | |||
import fsp from 'fs/promises'; | |||
|
|||
import oas2har from '@har-sdk/oas'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import oas2har from '@har-sdk/oas'; | |
import { oas2har } from '@har-sdk/oas'; |
since you only use 1 function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too based on their doc but seems like it's incorrect
SyntaxError: The requested module '@har-sdk/oas' does not provide an export named 'oas2har'
scripts/specs/format.ts
Outdated
specMethod['x-codeSamples'].push({ | ||
lang: 'cURL', | ||
label: 'curl', | ||
source: new HTTPSnippet(harRequest as HarRequest).convert('shell', 'curl', { indent: '\t' }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why isn't it outputed like source: >
like the other snippets ? maybe you need to convert it to a string with .toString()
and replace the new lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point it's EXACTLY what i'm looking at right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a7aad85 seems enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much more readable !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks f great !
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/DI-3026
Changes included:
some customer requester cURL example in the API reference page https://www.algolia.com/doc/rest-api/search/, I assume it is to quickly try some stuff before setting up a real codebase
the openapi-generator is a bit overkill and doesn't properly handle oneOf cases, this simple solution seems to be enough