Questions tagged [openapi]

1

votes
1

answer
2.6k

Views

Swagger 3.0 schema error “should NOT have additional properties”

What does this error below mean? (Running in Swagger Editor) Schema error should NOT have additional properties additionalProperty: /buildinfo, /clearcache, /countries/{countryId}/cinemas/{theatreid}/screens/{screenid}/layout, /countries/{countryId}/cinemas/{theatreid}/screens Jump to line 0 Below i...
peter ivarsson
0

votes
0

answer
5

Views

Micronaut, OpenAPI (Swagger), Lombok and fluent API

the last two days I had the opportunity to play around with Micronaut. It looks nice and I like the built in support for OpenAPI (Swagger). I managed to have the OpenAPI documentation in a local Swagger-UI and I was able to create some documentation which is shown in Swagger-UI as expected. Then I m...
flexguse
1

votes
1

answer
557

Views

Multiple-line example in openapi v3 response body [duplicate]

This question already has an answer here: How to add multiple example values in swagger propertise? 1 answer Is there a way to code a multiple-line example in a request body? If possible I'd like my OpenApi document to display as follows when running under Swagger-UI. So far, all I've been able to...
Mike
1

votes
0

answer
293

Views

Vertx + OpenAPI + OAuth2 security handler is calling twice

I'm a newbie in vertx world. I used this link for setting up my openapi routing: https://gist.github.com/slinkydeveloper/bdf5929c2506988d78fc08205089409a Here is my sources: api.yaml #other endpoints... /api/v1/protected/verification: post: summary: Summary operationId: verification security: - Ap...
Bakhrom Achilov
1

votes
2

answer
98

Views

I'm needing some guidance on using OpenAPI (Swagger) with Drupal

I am new to Drupal but need to implement the OpenAPI (formally Swagger) to have it describe endpoints of the Drupal RESTful API. drupal/openapi has been installed with Composer but I can't find out how to load it in the browser as I can't find what the URL should be. Beyond that I was hoping to have...
Dubby
1

votes
0

answer
401

Views

How to localize OpenApi3 api defenition to several languages?

I have definition of my API as OpenAPI3 document and I'm using swagger UI as viewer. All 'description' fields now on English. But I need to support API documentation for several languages(English and Russian for example). How to localize OpenAPI3 document to several languages? Does some standard mec...
Frank59
1

votes
1

answer
475

Views

In Azure API Management Developer Portal, how can I display an openapi request body schema in a friendly format?

I'm attempting to publish a API (using json-api formatting) with Azure API Management by uploading my openapi 2.0 (nee. swagger) specification. I want to use APIM's built-in developer portal to serve documentation, but I've run into a bit of a snag with displaying the request body formatting. The o...
hoylemd
1

votes
1

answer
288

Views

Creating a dynamic swagger for an Elasticsearch API

I want to create a dynamic swagger of an elasticsearch API since the response returned by Api is unexpected because it contains facets and I would like to know if there is way to generate the swagger automatically through elasticsearch.
user3712104
1

votes
1

answer
457

Views

Swagger/Swashbuckle showing “Unknown response type”

I am creating an C# ASP.NET Core 2.0 REST API, all going well for the most part. It is using MVC routing to gen the REST API. The controllers are pretty simple. // POST: api/Volume/{zoneID}/Set/{volume} [HttpPost('{zoneId:int}/[action]/{volume:int}', Name = 'Set')] public IActionResult Set(int z...
Steven Goulet
1

votes
0

answer
25

Views

Is there a way to automatically create an API mockup from a Swagger file that produces different outputs depending on the request body?

I've been using Postman's API mockup features, but they are not smart enough to detect when a field is missing from the body and send a different response depending on the validity of a request (it can only do it with url parameters in GET requests). Is there any solution that is able to parse a swa...
kace91
1

votes
1

answer
85

Views

How to create a Sql Statement from a mutable Json File using Java

I'm trying to create SQL Tables from a Json File which is written following the OpenApi Specification. Here is an example of an Input file I must convert: 'definitions': { 'Order': { 'type': 'object', 'properties': { 'id': { 'type': 'integer', 'format': 'int64' }, 'petId': { 'type': 'integer', 'form...
Justin Oldfield
1

votes
1

answer
67

Views

Is it possible to reference the servers object from another OpenAPI file?

I'm documenting a list of APIs using OpenAPI 3.0 and a separate YAML file for each API. All APIs use the same target server, so currently I have the following in each API definition: ... servers: - url: www.abc.com description: 'Production Server' But I don't want to repeat the servers in all AP...
Manikanta Allada
1

votes
0

answer
49

Views

Is endpoint unit testing possible based on only OpenAPI 3.0 file?

After some googling I decided to directly ask this: Is it possible to run REST API endpoint 'build tests' based on solely an OpenAPI 3.0 specification file? I would like to add example request-response pairs to the OpenAPI spec file and have either an existing or self-written library run through all...
tscherg
1

votes
0

answer
464

Views

How to annotate a request body that is oneOf external models?

I'm working on documenting an API made with RESTeasy + Jackson in Java using Swagger/OpenAPI (version 1.5.18 - I did add in v3 OAS 2.0.1 to try oneOf/anyOf). One of the endpoints takes in a String as a request body, which is then transformed into one of several classes. The documentation needs to di...
Samvawa
1

votes
1

answer
44

Views

How to represent extraneous Swagger parameters

Our business is looking to create a Swagger document to represent an internal server. For various reasons, each request is required to include a series of extraneous header parameters: parameters: - name: device_id in: header required: false type: string - name: ip_address in: header required: true...
Andrew Emery
1

votes
1

answer
911

Views

OpenApi 3 import schemas from external files

I am defining common schemas for Web services and I want to import them in the components/schema section of the specification. I want to create a canonical data model that is common across multiple services to avoid redefining similar objects in each service definition. Is there a way to do this? Is...
Aldo
1

votes
1

answer
293

Views

Add Authorization to a specific Endpoint in Azure API Management

I am using Azure API Management to my API. In my API APP, I have one endpoint which requires JWT verification. I am trying to add the Authorization directly using the API Management, as shown in the following diagram. . However, when I add the Bearer Authorization directly and save it, it disappe...
CoderX
1

votes
0

answer
54

Views

How to return file contents from controller?

I'm trying to return the contents of an image file via a Python Connexion application generated from an OpenAPI v2 spec file using swagger-codegen and the python-flask language setting. In my controller module, I simply do the following: def file_contents_get(file_id): file = app.datastore.get_insta...
ScoPi
1

votes
0

answer
140

Views

NelmioApiDoc model definition / how to ignore getter or alias to existing property with other name?

Can we overwride model accessor property name or ignore it? Here my User::getUsername function which is an getter for email property (I need this function named like that to implement interface): class User extends AbstractDocument implements AdvancedUserInterface, EquatableInterface { /** * @var st...
FAjir
1

votes
1

answer
295

Views

Display Custom HashMap Key Using Swagger Annotations

I'm trying to generate Swagger documentation from Java code and one of my nested model properties is a HashMap. The generated example for it is as follows: 'additionalProp1': { 'customObject': {} }, 'additionalProp2': { 'customObject': {} }, 'additionalProp3': { 'customObject': {} } What I need it t...
Samvawa
1

votes
1

answer
228

Views

How can I validate OpenAPI's Schema Object

I'm using OpenAPI 3 Spec to document my APIs. I want to automate my tests so instead if asserting whole payload I'd validate it against documentation. But since OpenAPI is not a JSON Schema its Validation Spec won't work with OAS Schema Objects Is there a OpenAPI Schema Object Validation Spec?
You Care
1

votes
0

answer
224

Views

swagger core 2.0 disable security for endpoint

I am using Swagger Core 2.0 to generate openAPI 3.0 definition files and I am having trouble to disable 'security' for a particular endpoint. I have my securitySchemes and root security element defined: { 'openapi' : '3.0.1', 'security' : [ { 'JWT' : [ ] } ], 'paths' : { '/auth' : { 'post' : { '...
user62058
1

votes
0

answer
43

Views

Reuse OpenAPI/Swagger definition with different validation rules?

Let’s say I have a REST API with a User resource. There are three methods that work with the User resource: POST to create, GET to download and PATCH to change. All methods operate on the same User type, but have different required properties – when creating the user using POST, all request fiel...
zoul
1

votes
0

answer
228

Views

How to accept self-signed certificates when generating OpenAPI clients?

I have a rest service that is documented with OpenAPI 2.0. It is secured via a self-signed ssl-certificate, which cannot be replaced, because it is highly likely, the service will run on localhost in production. I generate a client from the OpenAPi specification with the swagger-codegen-maven-plugin...
tgr
1

votes
1

answer
243

Views

How to describe a map with object keys in OpenAPI/Swagger?

In my REST API, I want to use a hashmap Map where Foo and Bar are user-defined classes. How to describe such a map in OpenAPI (Swagger)?
Pooja
1

votes
1

answer
126

Views

Open API include a component inside another in paths

I think the title of my question is not very explicit, so I will try to explain it better here. I am currently writing my API documentation with the OpenAPI 3 specification and I have a little problem. I created two components 'Units' and 'MeasuresTypes'. One of the methods in my API is to retrieve...
Thomas Rollet
1

votes
1

answer
15

Views

Is it possible to exclude paths in Openapi code generation?

We are using a large third party API with many optional features. There are 27 endpoints and we need only a few of these from Maven. We are using server side generation. If you are interested the API is here: https://github.com/mjeffrey/psd2 Ideally we would only generate and expose the ones we supp...
MarkJ
1

votes
1

answer
300

Views

Does Django Rest Framework have third party apps to auto generate swagger.yaml file?

I have large amount of API endpoints written in django-rest-framework and it keeps increasing and updating. How can I create & maintain API documentation that should be up-to-date? My current version is Create swagger.yaml file and somehow auto generate everytime any endpoint changes. Then use th...
heykarimoff
1

votes
1

answer
60

Views

“Missing issuer google_id_token” when generating OpenApi doc for Cloud Endpoints with Auth0

I'm creating an app backend with GAE Standard Environment and Cloud Endpoints in Python that needs to be able to authenticate via Auth0. I have included an 'issuers' object in the API decorator (https://cloud.google.com/endpoints/docs/frameworks/python/authenticating-users#authenticating_with_auth0)...
igotquestions1
1

votes
0

answer
287

Views

OpenAPI Client Generator combine multiple files and projects

I'm using the OpenAPI generator(https://github.com/OpenAPITools/openapi-generator) to generate a C# client. I get two C# projects(OpenAPITools and OpenAPITools.Test) - Right now with the command below, a .sln and two projects are created - -jar openapi-generator-cli.jar generate -i libmaster_limi...
sandunes90
1

votes
0

answer
21

Views

Can I refer json which is written in Swagger 2.0 from a Json which is written in OpenApi 3.0

New to Swagger and openApi. I am trying to use openapi: 3.0.0. And I am using OpenAPI 3.0 parser I am creating one file in openApi 3.0 and I have one existing file which is in swagger 2.0. So I have to point/refer the file which is in swagger 2.0 from the file which is in openApi 3.0. And it is giv...
user2367130
1

votes
0

answer
28

Views

Should the OpenAPI definition be public?

We have an OpenAPI definition (json, using swagger), and I wonder what's a good practice to meet security concerns: I could either make the openapi.json file public (and restrict access to the services themselves by using security requirements inside the openapi definition), or I could already prot...
Dirk R
0

votes
0

answer
3

Views

How to specify in OpenAPI adding a user to a group?

I am attempting to create a custom connector for MS Flow\Logic Apps that uses some of the REST endpoints that are part of the microsoft graph but am having trouble in understanding how to document the API in OpenAPI 2.0 specification The MS documentation https://docs.microsoft.com/en-us/graph/api/gr...
Pete
1

votes
2

answer
954

Views

How to define constant string in Swagger open api 3.0

How to define constant string variable in swagger open api 3.0 ? If I define enum it would be like as follows 'StatusCode': { 'title': 'StatusCode', 'enum': [ 'success', 'fail' ], 'type': 'string' } But enums can be list of values, Is there any way to define string constant in swagger ope...
Harsha Gayan
1

votes
0

answer
207

Views

Workflow with Laravel & Swagger / OpenAPI

I'm currently working on an API which is based on OpenAPI 3.0 / Swagger. I find the API docs & code generation extremely useful, but what happens when a simple thing in the API changes? I would generate a new Server (based on Lumen / Laravel) and copy over the script files and every old code is gone...
Stefan
1

votes
1

answer
219

Views

Generate swagger/openapi docs from Mocha/Chai test suite

I want to use Swagger/OpenAPI to standardize documentation efforts. Most of the API's are built with NodeJS and I do integration testing with Mocha & Chai which helps tremendously with quickly making sure the API isn't broken after making changes. From what I understand, using Swagger won't replace...
jtlindsey
1

votes
0

answer
26

Views

How can I compare paths,definitions,parameters and responses between two OpenAPI / Swagger json API documentation?

I would like to find if there is a solution that helps with finding the differences between two different API versions of the same product(Swagger/Open API 2.0). For example, this tool : https://github.com/Sayi/swagger-diff compares parameters, responses, notes, http method(GET,POST,PUT,DELETE...),...
Christos220
1

votes
1

answer
34

Views

Testing API with Swagger/OAS

I've spent some time documenting an API with Swagger/OAS 3. I want to validate our current API conforms with the OAS 3 document. How can I do this?
Noodles
1

votes
0

answer
110

Views

Creating public and private Open API documentation from yaml file

I have an OpenAPI document to describe some Endpoints. Some of those endpoints shall be public (visible for final users) and other private (visible to dev team only). I'd like to know if is there a way to create only 1 yaml file containing all api methods and generate 2 docs page (1 for public endpo...
marionmaiden
1

votes
1

answer
135

Views

OpenAPIv2(Swagger2) + GraphQL

We have built a REST service which is documented using OpenAPIv2 specification. We do code generation using swagger-codegen and build service on JAX-RS. We are looking to add GraphQL to our existing REST service. Looking for best possible way to integrate GraphQL into existing OpenAPI(Swagger)v2 s...
Abhijith Prabhakar

View additional questions