我想生成一个“开箱即用,面对客户”(在理性!)中,从OpenAPI规范中进行UI - 这是我的Nice-to-to-to-Haves购物清单:
- 显示具有某种类型的API实体列表层次结构相关的
- 单击实体的层次结构将显示 paged , sortable , forterable crifable grid for该实体
- 基本UI用于添加/编辑新实体配有每个实体属性的类型编辑器/验证
- ,允许进行样式/逻辑自定义,而我仍然允许重新生成UI,
我知道Swagger UI项目,甚至 react版本,但它会生成“ nofollow noreferrer”>以技术为中心的输出这对于尝试API非常有用,但就面向客户的应用程序而言,我在这里的追求不是很重要 - 也许可以自定义,或者有人知道替代方案?
I'd like to generate an "out of the box, customer facing" (within reason!) React UI from an OpenAPI specification - here is my shopping list of nice-to-haves:
- Show a list of API entities with some sort of hierarchy where they are related
- Clicking on an entity would display a paged, sortable, filterable grid for that entity
- Basic UI for adding/editing new entity complete with type editors/validation for each entity property
- Allowing for styling/logic customisations whilst still allowing re-generation of the UI
I am aware of the Swagger UI project and even the React version, but it generates a very tech-centric output which is great for experimenting with the API but not quite what I am after here in terms of a customer-facing application - perhaps it can be customised, or does anyone know of alternatives?
发布评论
评论(1)
据我所知,除了您还有另一个可靠的选项,即 stoplight-elements :
这是一个很好的解决方案(我们目前在其中一个项目中使用它)使用JSON字符串渲染OAS文件。它目前适用于React和NextJS应用程序,为了自定义,您可以根据需要将主CSS导入编辑。
As far as I know apart from swagger-ui-react you have another solid option here that is stoplight-elements:
It's a pretty good solution (we're currently using it in one of our projects) to render OAS files using JSON strings. It currently works for both React and Nextjs apps and in order to customize you could import the main CSS an edited as you like.