Questions tagged [swagger]

0

votes
0

answer
9

Views

Swagger-UI emplyeed in nginx by bunled jar, it shows blank page

Swagger-ui can visit on 'dev' environment, But it fail when I deploy it in cloud. I tried AddResoucesHandler, but it is not working. error message: GET https://user.throw.atatakai.cn/webjars/springfox-swagger-ui/springfox.css?v=2.9.2 net::ERR_ABORTED 404 (Not Found) swagger-ui.html:8 GET https://u...
Emwing
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
1

votes
1

answer
1.8k

Views

How do I swagger generate Kotlin?

I'm trying to generate kotlin code from a swagger json file, and I can't figure out the command-line parameters that should be used. I've tried Swagger codegen v2.3.1 and v2.2.3 and both fail for kotlin, kotlin-client, and kotlin-server with the same error. What's the correct switch to generate Kot...
John Kaster
0

votes
0

answer
13

Views

How to bring another project (get,post) api method to swagger api project?

I've created one API project with asp.net core in which I used swashbuckle.AspNetCore dll to generate swagger. It is working perfectly and going well. Now I have another c#(.net standard library) in which I have created some GET, POST, DELETE, PUT method. Need to load all of those methods to the swa...
sk5202
1

votes
1

answer
74

Views

Template deployment to Azure API management with swagger fails with 'path' must not be empty

I am trying to create an API and operations in azure API management using the swagger import feature, using a template derived from the doumentation at https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2018-01-01/service/apis Every time I deploy my API using my Azure Resource...
alastairtree
1

votes
1

answer
108

Views

empty JSON parameters for array POST in swagger

I'm using nest.js and I have a post route to add new news to database so I used postman to send array of objects like this: [ { 'newsTitle' : 'title1', 'newsDescription': 'description1' }, { 'newsTitle' : 'title2', 'newsDescription': 'description2' } ] and this the code for post in my controller:...
GNDevs
1

votes
1

answer
303

Views

Swagger with Flask-Restplus, API and multiple Blueprints

I'm building a very complex microservice using Flask and Flask-Restplus. It will have many endpoints, thus I'm organizing each endpoint into a separate Blueprint. Currently, I'm struggling with the usage of Flask-Restplus and API using multiple Blueprints in combination with swagger I want to be abl...
dacoda
1

votes
4

answer
103

Views

RESTful API endpoint naming

I'm working on a asp.net core 2.2 backend exposing a RESTful API. The current implementation works fine (additional code removed for clarity): namespace Sppd.TeamTuner.Controllers { [Authorize] [ApiController] [Route('[controller]')] public class UsersController : ControllerBase { private readonly I...
Philippe
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
0

answer
6

Views

Auth0 + Swashbuckle .Net Core 2.2. Missing claims in jwt token when using SwaggerUI

I am making a ASP.Net Core WebApi which is authentication via Auth0. I am using Swagger and SwaggerUI and trying to authenticate from Swagger UI. // Add authentication services services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; option...
Tonven
1

votes
1

answer
141

Views

Swagger Invalid json message received

I'm using Symphony 4 with Doctrine and now I'm implementing / adding Swagger, so I will have proper docs where testing my api will be available. This is my postman, with proper inputed form data and OK response. And this are my 'problematic' notations of Swagger * @Route( * '/request', * na...
Valor_
1

votes
1

answer
70

Views

How to separate controllers by areas in Swagger 3?

I'm implementing Swagger in an integrations api and in that case it was necessary to separate these services by area for project organization issues, but I have the following problem, some controllers have common names in different areas and when swagger generates the documentation, even separated b...
Leonardo Fonseca
0

votes
0

answer
6

Views

Error while generating NodeJs server code in swagger

While trying to generate nodejs server I am getting the below errors. Uncaught (in promise) Error: Internal Server Error at index.js:1 at tryCatch (runtime.js:62) at Generator.invoke [as _invoke] (runtime.js:296) at Generator.e.(/swagger/anonymous function) [as next] (https://abcdef.com/swagger/dist...
Namani Supriya
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
1

answer
259

Views

Using Retrofit + OkHttp + Gson the api returns html though postman return json

I tested my api in postman and it returns json just a plain get api baseurl/ecom-services/api/mobile/tasks/user/tokenhere_/upcoming but on Android @GET('mobile/tasks/user/{id}/upcoming') fun jobList(@Path('id') id: String): retrofit2.Call this returns an html onError returns this: java.lang.Illeg...
renzvader
1

votes
0

answer
682

Views

How to use API client auto-generated by Swagger (Java - Retrofit2)?

Here is the code that Swagger generates: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/java/retrofit2 Example code is not working: https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/java/retrofit2/docs/PetApi.md io.swagger.client.A...
Defozo
1

votes
0

answer
784

Views

Generate Swagger Documentation for existing NodeJS server

I'm trying to document my API using Swagger, but if I do the documentation by myself and manually, I'll spent a lot of time, and then I saw this question on SO, and the last answer is about the express-oas-generator that seem's to be a good tool. Generated my documentation with success, but the POS...
Lucas_Santos
1

votes
0

answer
450

Views

java.io.FileNotFoundException: Could not open ServletContext resource [/application.properties]

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.gaian.adwize.ssp.main.SSPStarter]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/application.properties] at org.springframework.context.annotation.Co...
ShantiRadhkrishnan
1

votes
0

answer
378

Views

swagger editor UI sends a OPTIONS request method instead of PUT and DELETE

http://editor.swagger.io sends a OPTIONS request method instead of PUT and DELETE but for POST and GET it's work perfectly even I have installed a Chrome extension that adds Access-Control-Allow-Origin to outgoing requests. and same added in the c# code like below [EnableCors(origins: '', headers:...
Raj Kumar
1

votes
0

answer
160

Views

Request with POST Body consisting of Key/Value pairs AND an Object (for Swagger) Parameters

Until now i have used application/x-www-form-urlencoded to pass key value pairs in the body and if i had to pass an object applicaton/json post: tags: - 'users' summary: 'Create User' operationId: 'createUser' consumes: - 'application/x-www-form-urlencoded' parameters: - name: 'username' in: 'formDa...
Gobliins
1

votes
1

answer
232

Views

Asp.net Web api core 2 and Swagger when adding [Routing] attribute, Response Content Type '*/XML' disappears

I am using Asp.net web.api core 2.0 and Swashbuckle 1.1.0. Input and ouput XmlSerializer has been added. When I add [Route] attribute to an action, swagger UI Response content type 'text/xml' or 'application/xml' is removed from the option list. Any ideas why this is occuring? [HttpGet('....')] pub...
Floyd
1

votes
1

answer
375

Views

generate separate angular service file for each controller in my api

this produces a single output containing all the generate clients (angular services) is it possible generate different output (different service.ts) for each controller this is my current code string sUrl = 'http://localhost:7325/swagger/v1/swagger.json'; var document = SwaggerDocument.FromUrlAsync(...
alex
1

votes
0

answer
555

Views

How to write the Array In Swagger?

API Documentation in Swagger - name: orderNo in: query description: Number of the order required: false schema: type: integer format: int32 - name: orderName in: query description: Name of the order required: false schema: type: string JSON 'orderNo': 6362131469, 'orderName': 'HuntPrivateOrder', 'li...
Handsome Programmer
1

votes
0

answer
250

Views

Dynamic Request body REST API Method using swagger

I have use case were I need to get requestBody based on selection of field.below is same code which I was able get the dynamic responseBody Based on selection ProtocolType.Is there is any way that swagger can read the RequestBody Dynamically. Controller.Java @ApiOperation(value = 'Protocol Account',...
user12222
1

votes
0

answer
867

Views

ASP.NET Core 2.0 - Web API Method Multiple Endpoints

This is my controller: [Route('api/[controller]')] public class SaveRecordController : XivicControllerBase { #region REST Calls [HttpPost] public SaveRecordResponse Post([FromBody] SaveRecordRequest saveRecordRequest) { var retVal = new SaveRecordResponse(); try { ValidateRequest(saveRecordRequest);...
Melbourne Developer
1

votes
0

answer
893

Views

swagger ui with spring security

I need specific role to access swagger ui snippet to access swagger-ui with role 2 ( tried following with no joy) http .csrf() .disable() .authorizeRequests() .antMatchers('/api/**').hasAuthority('ROLE_ROLE1') .antMatchers('/login/**').permitAll() .antMatchers('/info/**').permitAll() .antMatchers( '...
Jagruti Frank
1

votes
0

answer
39

Views

Downloaded file is corrupted in loopback, hyphens are added

I am using loopback which connects with mongodb. When I try to download a file using loopback UI GET /containers/{container}/download/{file} its response is success but when i clicked on link it downloads corrupt file. pdf-sample.pdf Same URL when I hit on browser it works correctly. Also when I hit...
jheel v
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
152

Views

Duplicate function implementation while creating restful service

I'm trying to create my service as restful, but when I run Refresh.bat file and run npm start. It gives errors. [HttpPost('api/services/app/Test')] public async Task CreateTest(TestDetailsDto input) [HttpDelete('api/services/app/Test')] public async Task DeleteTest(EntityDto input) [HttpGet('api/ser...
vivek nuna
1

votes
1

answer
424

Views

Swagger- Schemes HTTP and HTTPS with different ports

How does one specify multiple schema with different ports? Specifically, I want to have HTTP on port 81 and HTTPS on port 444. swagger: '2.0' info: version: 1.0.0 title: API for gateways description: API for gateways to access server (port 81 for http and 444 for https) schemes: - http - https host...
user1032531
1

votes
1

answer
331

Views

Swashbuckle cannot change index.html (CustomAsset doesn't exist)

I'm using Swashbuckle for my ASP.NET core project and I want to modify my index.html and I saw this page: https://github.com/domaindrivendev/Swashbuckle/tree/swagger_2.0#provide-your-own-indexhtml that explains exactly how to do that, but the thing is that the method CustomAsset method doesn't seem...
Claude Roy
1

votes
0

answer
114

Views

How to show parameters of Grape API when it is hash or array and the inside value isn't defined with swagger doc

I am using swagger doc to generate API document in grape api. API parameters are defined like: desc 'Get results by query' params do requires :type, type: String, desc: 'search type' requires :body, type: Hash, desc: 'query body' optional :user, type: Hash, desc: 'support search as other user...
李梦驰
1

votes
1

answer
461

Views

How to accept Form Params with multipart file upload

I'm working on a REST application hosted on a Liberty server that should allow support for file upload. As a part of this POST request, I'd like to allow the user to specify a few things with Form parameters. Despite using the example from IBM here, I can't quite get it to work. I can retrieve infor...
Casey
1

votes
0

answer
636

Views

Springfox Swagger2 and Guava - java.lang.StackOverflowError

I added Springfox Swagger2 2.8.0 in my Spring Boot 2 project and during startup of the application, run into the following issue: com.google.common.util.concurrent.ExecutionError: java.lang.StackOverflowError at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2216) ~[guava-23.0.jar:na...
alexanoid
1

votes
0

answer
381

Views

swagger UI not reachable while running on Docker proxied through Nginx and hosted by gunicorn

I have a Flask (with Flask-restplus) app running locally on port 5000. When I launch the app locally and go below URL I can see the Swagger UI. http://localhost:5000/api/# But when I run it behind NGINX, gunicorn and go to http://localhost:81/api/# I get below error Can't read from server. It may no...
Mateen-Hussain
1

votes
2

answer
504

Views

Is there a way to automatically generate Swagger tags from precomipled C# Azure Functions?

Is anyone aware of any .NET attributes that can be used to annotate a precompiled C# Azure Function so it can generate Swagger tags automatically? For example, I would like to auto-generate the 'tags' entry in Swagger: /api/v1/revision: get: operationId: /api/v1/revision/get tags: - System produces:...
TruthSeeker
1

votes
1

answer
160

Views

The method is not allowed in Swagger UI after adding the controller

I have Swagger added to the project and it works https://zapodaj.net/217c8a0dcf348.png.html. After adding the controller @RestController(value = '/register') public class RegisterRestController { ... @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.CREATED) public...
sdfgsdgsgr
1

votes
1

answer
65

Views

Swagger Configuration to Specify Authentication Schema

I have specified the Swagger annotations, used to generate the Security/Authentication required for the API; as per the Swagger documentation. @ApiOperation(value = 'Add a new pet to the store', authorizations = { @Authorization( value='petoauth', scopes = { @AuthorizationScope( scope = 'add:pet',...
Ankzz
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
263

Views

Swagger parse associative array with undefined properties

I'm trying to figure out how to achieve for Swagger to parse an associative array with an undefined number of values. I have similar cases, with the difference that these other cases are totally regular (I know in advance all the properties' names). However, I might not know (actually I don't want t...

View additional questions