openapi

Add endpoints manually with Swashbuckle.Swagger

心已入冬 提交于 2019-12-12 12:25:49
问题 I'm using a CMS. So when I go to i.e. '/painter' its routed to the 'JobController'. /plumber is also routed to 'JobController'. Besides that it's MVC and not WebAPI, so swagger doesn't discover it, which is understandable and fine. But I've a usecase, where if I access /pianter?json=1 it returnes json instead of HTML. So as an API UI we would like to expose this 'fake' endpoint, just so the designers can see the output model. So can I add an entirely fake endpoint - just to have a single

What is the significance of servers property in OpenAPI 3.0?

…衆ロ難τιáo~ 提交于 2019-12-12 07:07:23
问题 In the OpenAPI 3.0 Specification, the root OpenAPI Object has the servers property which is an array of Server Objects. And the Path Item Object also allows an optional servers property. The description given in the Specification does not give a clear idea of how servers can be helpful. What is the significance of the servers property? Do we have any example which explains the use cases of servers both as a direct property of the root OpenAPI object and also as a property of a path item? 回答1:

Open api 3.0 mock Generator [closed]

房东的猫 提交于 2019-12-12 06:21:57
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am learning Open API Specification. Is there any tools to perform mocking on API based on the open API specification in YAML file. Thanks in Advance ps: I am using the currently released draft version of open API (OpenAPI 3.0) 回答1: SwaggerHub includes a mock server for OpenAPI 2.0 and 3.0 specs. Mocking is

Should I define different POST and PATCH models in OpenAPI?

匆匆过客 提交于 2019-12-11 17:58:29
问题 I am defining a REST API in OpenAPI3 (Swagger). I have an API that has a POST which uses a Model I have defined in teh components section as follows: post: summary: "Used to add some data" operationId: postMyData requestBody: content: application/json: schema: $ref: '#/components/schemas/MyModel' required: true components: schemas: MyModel: type: object properties: SomeProperty1: type: string SomeProperty2: type: string SomeProperty3: $ref: '#/components/schemas/SomeOtherModel' SomeProperty4:

How to define a reusable body parameter that is a primitive data type in OpenAPI 3.0?

放肆的年华 提交于 2019-12-11 13:34:54
问题 I'm creating an OpenAPI 3.0 specification/description of an API in which many of the request bodies include some of the same parameters, and those parameters are primitive data types like strings or integers. For example: imei: type: integer format: int64 description: 4G hardware device identifier I'd like to define those parameters just once in the "components" object and then use $ref to include them where needed instead of having the same parameter defined in a dozen different request

Integrating HealthCheck endpoint into swagger (open API) UI on dotnet core

我们两清 提交于 2019-12-11 11:29:52
问题 I am using Dotnet Core healthchecks as described here. In short, it looks like this: First, you configure services like this: services.AddHealthChecks() .AddSqlServer("connectionString", name: "SQlServerHealthCheck") ... // Add multiple other checks Then, you register an endpoint like this: app.UseHealthChecks("/my/healthCheck/endpoint"); We are also using Swagger (aka Open API) and we see all the endpoints via Swagger UI, but not the health check endpoint. Is there a way to add this to a

Is there a way to convert OpenAPI specifications to json mappings in maven?

一笑奈何 提交于 2019-12-11 10:03:14
问题 I need to convert OpenAPI specifications into json mappings so I could use them in my wiremock server, but I'm not sure if there is an available plugin to do this type of conversion. This is an example of an OpenAPI I'm using openapi: "3.0.0" paths: /fraudcheck: put: summary: Perform Fraud Check x-contracts: - contractId: 1 name: Should Mark Client as Fraud priority: 1 requestBody: content: application/json: schema: type: object properties: "client.id": type: integer loanAmount: type: integer

How to display object properties as separate fields in Swagger UI?

和自甴很熟 提交于 2019-12-11 07:05:51
问题 I am writing API documentation using OpenAPI 3.0. At the moment I have: paths: /script/update: post: tags: - "Script" summary: Update a script operationId: updateScript responses: '200': description: OK "404": description: Not Found requestBody: description: A script object in order to make the request required: true content: application/x-www-form-urlencoded: schema: type: object properties: subsite_id: type: string script: type: object properties: script: $ref: '#/components/schemas

Open Api documentation for a single endpoint multiple posts request

泄露秘密 提交于 2019-12-11 05:18:33
问题 I am trying to have Swagger/Open Api documentation for my single endpoint API. My single endpoint looks like POST: http://localhost/api/v1/process the post body determines the logical path and response schema Body1: {"jsonClass": "AnimalsRankedByLifeSpan"} Response1: schema-1 Body2: {"jsonClass": "AnimalsInRegion", "region":"Africa", "type":"lions"} Response2: schema-2 Expectation from documentation: Each jsonClass is listed as a separate call in swagger (or any other) and I can use the spec

Passing a path parameter to Google's Endpoint for Cloud Function

有些话、适合烂在心里 提交于 2019-12-11 04:47:46
问题 I am following Google's tutorial on setting up Google Cloud endpoint (not AWS API Gateway) in front of my Cloud Function. I am triggering my Cloud Function to trigger an AWS lambda function, AND I am trying to pass a path parameter from my Endpoint as defined by OpenAPI spec. Path parameters are variable parts of a URL path. They are typically used to point to a specific resource within a collection, such as a user identified by ID. A URL can have several path parameters, each denoted with