TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: A faster way to prototype your APIs using OpenAPI 3 and Swagger UI

77 点作者 yehors超过 4 年前

13 条评论

hardwaresofton超过 4 年前
Hey you might want to note a bit more about what exactly this does and how it does it on the README. I went to the page and was thoroughly confused -- does this library:<p>- Read application code (written in python?) and extract an API specification? Is it flask only?<p>- Does it update the file on disk repeatedly?<p>- Does it modify generated application code to add an endpoint for the Swagger UI and host it?<p>- Are any modifications to the pre-existing applications necessary?<p>- Does it wrap an existing application?<p>Good tools also often have a comparison section -- are there other tools in your space that do what you do, but differently?<p>I&#x27;d like to think I&#x27;m familiar with the Swagger&#x2F;Swagger2&#x2F;OpenAPI3 space, and I&#x27;m aware of tools that go spec-&gt;code (usually generating clients&#x2F;servers) and code-&gt;spec (whether by comments, annotations, or some other language mechanism), but it&#x27;s not clear what your tool actually does.
评论 #24870515 未加载
OJFord超过 4 年前
Shameless plug, I did something similar in Rust (that is, 2017 rust that I haven&#x27;t gone back to) for my MEng project.<p>I really wish more APIs&#x2F;people used OpenAPI, I think&#x2F;thought it&#x27;s fantastic, but I haven&#x27;t really used it since. Docs-only at work, a bit, but it has so much more potential.<p>--<p>Main difference in mine is that I used the OpenAPI spec as the starting point though - I wanted to be able to use it as an API-specific HTTP client. From that I inferred type signatures at compile-time in order to enforce correct (per the spec) use of an API, and enforce handling all the (stated) possible error cases. Idea being that if you did the same on the server side, you&#x27;d have pretty good guarantees about your communication.<p>Kept meaning (still mean?) to go back to it, but I haven&#x27;t yet. It supports the basics, but it&#x27;s far from battle-tested; I might never get back to working on it, but if it&#x27;s of interest to anyone for (absolutely non-production) toying around, I&#x27;ll certainly respond and act on any PRs.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;OJFord&#x2F;tapioca" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;OJFord&#x2F;tapioca</a><p>It seems they&#x27;re not linked from the readme (probably I was scared to update it post-deadline in case of examiner doubt, and presentation&#x2F;slide manufacture was post-submission deadline) but there&#x27;s also slides (linked from the release) that perhaps have a bit more detail on what I was going for from a more technical perspective (though it&#x27;s been a while):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;OJFord&#x2F;tapioca&#x2F;releases&#x2F;download&#x2F;v0.0.1&#x2F;slides.pdf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;OJFord&#x2F;tapioca&#x2F;releases&#x2F;download&#x2F;v0.0.1&#x2F;s...</a>
dvlx超过 4 年前
Even easier with FastApi<p><a href="https:&#x2F;&#x2F;fastapi.tiangolo.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fastapi.tiangolo.com&#x2F;</a><p>Auto generates both interactive SwaggerUI and Redoc pages.<p>Can turn off before production deployment.
评论 #24876394 未加载
评论 #24870634 未加载
评论 #24871015 未加载
adenta超过 4 年前
As someone who used openAPI for the first time recently, I don’t understand the benefit.<p>Im building an integration between two different API’s. I was given the openAPI spec and instructed to find a mock server generator to get a boilerplate app up. I spent like two hours trying to find some sort of generator that provides value. All the generators I tried seemed half baked (I wanted to use rails for this project, because that’s what I am most familiar developing in. I understand rails is a sub optimal choice for this project.)<p>In the time I wasted trying to find a generator, I could’ve just wrote the code by hand. Once I just started manually writing code, everything started moving much quicker. Even if I had used a generator, I’d still need to manually update things every time the interface changes, yeah? Who is openAPI for?
评论 #24869211 未加载
评论 #24869030 未加载
评论 #24869108 未加载
评论 #24869151 未加载
BerislavLopac超过 4 年前
Shameless plug: I have been developing Pyotr [0], a helpful async library - based on top of Starlette [1] and httpx [2] - which is using OpenAPI as the specification for routing and validation, both on server and client side.<p>[0] <a href="https:&#x2F;&#x2F;pyotr.readthedocs.io" rel="nofollow">https:&#x2F;&#x2F;pyotr.readthedocs.io</a><p>[1] <a href="https:&#x2F;&#x2F;www.starlette.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.starlette.io&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;www.python-httpx.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.python-httpx.org&#x2F;</a>
评论 #24876423 未加载
carapace超过 4 年前
I&#x27;ve been out-of-the-loop for a while, what&#x27;s the state of the art in re: OpenAPI&#x2F;Swagger?<p>What I mean is, are people using it in the wild? Are there mature (or at least pretty stable) code generators? Test generators? What&#x27;s inter-operability like? (Is it easy&#x2F;possible to generate clients and server stubs in different languages that will work together? Can I write a service, publish my API spec, and expect people to be able to use it to write clients?)
apocalyptic0n3超过 4 年前
Just a heads up, there are a number of similar&#x2F;identically named projects:<p>- <a href="https:&#x2F;&#x2F;openapi-generator.tech&#x2F;" rel="nofollow">https:&#x2F;&#x2F;openapi-generator.tech&#x2F;</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;zijianhuang&#x2F;openapiclientgen" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zijianhuang&#x2F;openapiclientgen</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;deepmap&#x2F;oapi-codegen" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;deepmap&#x2F;oapi-codegen</a><p>I swear I&#x27;ve come across a few others while looking for the best web visualizer (mostly settled on Redoc), but I&#x27;m not finding them on <a href="https:&#x2F;&#x2F;openapi.tools&#x2F;" rel="nofollow">https:&#x2F;&#x2F;openapi.tools&#x2F;</a> or <a href="http:&#x2F;&#x2F;openapi.toolbox.apievangelist.com" rel="nofollow">http:&#x2F;&#x2F;openapi.toolbox.apievangelist.com</a>, so perhaps they&#x27;ve been abandoned
Twisell超过 4 年前
As other mentioned this the description is particularly non-user friendly for something that (as far as I understood) is related to a documentation management system.<p>I&#x27;m mostly a backend GUI but still interested in learning more about web API. But the only description sentence is presuming that reader is comfortable with a highly specialized jargon. On the other hand I smell that &quot;any project&quot; is probably far narrower than it sound.<p>&gt; <i>The goal of this project is to create a generator that conveniently creates API definitions in OpenAPI 3 format and then injects the generated YAML file with Swagger UI to any project.</i>
codenesium超过 4 年前
Shameless plug! Generate a .net core skeleton from a OpenAPI spec. It&#x27;s a work in progress.<p><a href="https:&#x2F;&#x2F;www.codenesium.com&#x2F;projects" rel="nofollow">https:&#x2F;&#x2F;www.codenesium.com&#x2F;projects</a>
tlarkworthy超过 4 年前
I am confused when people try to generate api specs from languages (e.g. typescript to openAPI). The big draw to API specs for me is language independence. By generating from an implementation it&#x27;s the wrong way round and you lose a degree of freedom IMHO.
评论 #24871021 未加载
Nijikokun超过 4 年前
Insomnia Designer can help you develop and manage your OpenAPI specs as well :)<p><a href="https:&#x2F;&#x2F;insomnia.rest&#x2F;products&#x2F;designer" rel="nofollow">https:&#x2F;&#x2F;insomnia.rest&#x2F;products&#x2F;designer</a>
评论 #24872303 未加载
_the_special_超过 4 年前
the README file of this repo does not help me understand what this project is about as someone who has never used OpenAPI (and only faintly used Swagger UI for a short time before).
kapilvt超过 4 年前
went through the code, there&#x27;s nothing here that i can see. its just a demo pet store app in flask.
评论 #24869476 未加载