Questions tagged [swagger-ui]

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
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
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
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
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
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
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
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
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
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
0

answer
721

Views

Springfox 2.8.0 unable to infer the base URL

After updating Springfox to 2.8.0, I started to experience the following issue: Swagger tries to access the following resource: http://localhost:8080/api/swagger-ui.html/swagger-resources/configuration/ui instead of a correct one: http://localhost:8080/api/swagger-resources/configuration/ui How to f...
alexanoid
1

votes
1

answer
1.1k

Views

How to add custom header for every request in swagger json file

I've copy swagger.json file from one of the service and want to import it into Postman collection Then the problem is I want to add custom API-key in header for every requests. I've read about securityDefinitions but it doesn't seems to work Let's say it's name is myCustomAPIKey, Is there a way that...
1

votes
0

answer
189

Views

swagger integration to document spring rest APIs

I am trying to integrate swagger to my application to document my rest APIs. My application is not Maven dependent so I included all required jars manually. After changes have been made, hitting /v2/api-docs doesn't return any JSON output but a 404 response instead. Hitting /swagger-ui.html a page w...
user9363955
1

votes
1

answer
442

Views

Django Rest Framework Session + Token Auth issue

Hello again all wonderful experts helping noobs like me! This time in my DRF api I am using token auth but before I upgraded to django2 and python3, session auth worked as well at least from my computer to my server. Now if I run it on local host during development and I login to my admin panel at /...
Mark
1

votes
0

answer
109

Views

Swagger UI: Pass in authorization token as a byte string

I'm new to Swagger. I've figured out how to add another parameter to add to the header to every api call I have. I created an operation filter for that. public class AddAuthorizationHeaderParameterOperationFilter : IOperationFilter { public void Apply(Operation operation, SchemaRegistry schemaRegist...
user3093582
1

votes
0

answer
311

Views

Swagger-UI and GitHub Pages (gh-pages)

Has anyone reading this board have Swagger-UI up and running on GitHub Pages? I got as far as displaying the Swagger-UI main page, but the Try-it-Out feature does not work.
Mike
1

votes
0

answer
43

Views

Swashbuckle and NGINX redirection

I'm trying to setup swashbuckle with my web API. It's working pretty good locally with these settings : app.UseSwagger(c => { c.RouteTemplate = 'swagger/{documentName}/swagger.json'; }); app.UseSwaggerUI(c => { c.SwaggerEndpoint('v1/swagger.json', 'Swagger - API V1'); }); With these settings, I ca...
Kinetic
1

votes
1

answer
721

Views

Swagger-ui on GKE 1.9

I am running a kubernetes cluster on GKE. I have been told that Kubernetes API server comes integrated with the Swagger UI and the UI is a friendly way to explore the apis. However, I am not sure how to enable this on my cluster. Any guidance is highly appreciated. Thanks!
jraj
1

votes
1

answer
83

Views

SWAGGER-PHP error when generating .json I can not load the values from my model

Hi guys I tried to eliminate this error that persists when I generate the swagger.json, the error says: [WARN] [Syntax Error] Expected Value, got '@' in \App\Http\Controllers... and in my code, OHH iM WORKING WITH LUMEN. /** * @SWG\Put( * path='/v1/resource/{id1}/rsc/{id2}', * summary='Update .....
1

votes
1

answer
200

Views

Receive and send an authorization token in Swagger

I am creating a documentation page with Swagger, and I would like to automatically add the access token received from a correct /login call. I tried using responseInterceptor: (responseObj) => { if(responseObj.obj.access_token !== 'undefined'){ token = responseObj.obj.access_token; } return response...
Sebastian Torres
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
725

Views

Nested path for swagger

I am a beginner in Swagger. I have made these 2 api docs: /user: /user/{id}: I want both these paths under /user i.e. /user/{id} should not open differently as shown in image. I want both get under /user. Both have get methods. (get all users and get user by id.) Is there a concept of nested paths...
Shachi
1

votes
0

answer
102

Views

Remove all of the commas in swagger model documentation

I want to get rid of the commas in swagger's model documentation. For example: Each property (other than the last one) is described with a comma at the end of the string. How can I get rid of that? I tried an OperationFilter but the commas seem to be added later than that (perhaps in the UI?) (Ed...
Tom Kludy
1

votes
1

answer
165

Views

Swagger with spring boot microservice

I have a microservice-A which gets the token as a header from another microservice-B. Now I want to implement swagger2 in microservice-A. The problem is every request flows through microservice-B. So swagger-ui throws error in local as it is not able to get those header parameter which microservice...
Pooja Mahapatra
1

votes
0

answer
333

Views

How to view <swagger-ui-url>/app.yaml content in the browser and not download the yaml file instead?

I am using swagger api documentation tool for my backend, and I need to view the contents of the .yaml file in the browser when the url is called. But instead, I always end up having the file downloaded. This is the content of my SwaggerUI tag: window.onload = function() { // Build a system const u...
Yash Soni
1

votes
1

answer
3.5k

Views

Spring Boot Security - How to disable security for Swagger UI

I have an application with only REST endpoints. I have enabled oauth2 token security via: @Configuration @EnableAuthorizationServer public class AuthServerOAuth2Config extends AuthorizationServerConfigurerAdapter { @Override public void configure(ClientDetailsServiceConfigurer clients) throws Exce...
starman1979
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
1

answer
509

Views

How to set date format ( 2018-04-09 10:10:10 ) input in swagger JSON

I am currently using below swagger spec for above particular date format 'requestDt': { 'title': 'requestDt', 'description': 'requestDt', 'pattern':'[0-9]{4}-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]', 'type':'string' } it shows in doc page like below 'requestDt': 'string' The problem...
Arunkumar
1

votes
0

answer
236

Views

Swagger UI running in Docker uses internal port; can't use try out function

Using swagger-node I setup a project using Express and swagger-ui-express. Dockerfile FROM node:8-alpine WORKDIR /opt/app COPY package*.json ./ RUN yarn install COPY . . CMD [ 'yarn', 'start' ] docker-compose.yaml version: '3' services: app: build: . ports: - 15000:10010 Starting the container docke...
Robert Strauch
1

votes
0

answer
952

Views

Swagger UI - Response code

I am quite new with Swagger and I am a little bit confused with the response codes given back. I wrote a code with th purpose that it should drop an error message with the response code 500. If I let my code run, then the method gives a 200 - ok status, although in the header is my error code visibl...
dorcsi
1

votes
0

answer
76

Views

ServiceStack Swagger UI 500 Error

I'm getting a 500 error when testing a ServiceStack API using Swagger UI. Here's the plugin code: private void InitializePlugins(Container container) { Plugins.Add(new ValidationFeature()); Plugins.Add(new PostmanFeature()); Plugins.Add(new SwaggerFeature() { RouteSummary = { {'/resource/Messages',...
cksanjose
1

votes
0

answer
60

Views

Scala - Swagger : Using a trait as a response type for @Apiresponse

@ApiResponses(Array( new ApiResponse(code = 200, message = 'OK', response = classOf[ResultBase]), new ApiResponse(code = 500, message = 'Internal server error'), )) and this is my trait: @ApiModel(value='Event', description='Base class for events') sealed trait ResultBase { @(ApiModelProperty @field...
Mhd.Tahawi
1

votes
1

answer
58

Views

owin multiple instance and swagger

I would like run multiple instance. I'm using the following code var option = new StartOptions(); option.Urls.Add('http://localhost:9000/Foo'); var app = WebApp.Start(option, Startup) var option2 = new StartOptions(); option2.Urls.Add('http://localhost:9000/Bar'); var app2 = WebApp.Start(option, Sta...
Marcus X
1

votes
0

answer
350

Views

Swagger UI — No 'Access-Control-Allow-Origin' header is present on the requested resource

I'm writing an API in Java, and using Swagger to document it. However, when I attempt to 'Try It Out' in Swagger, I get a prompt that reads: No 'Access-Control-Allow-Origin' header is present on the requested resource. I have added headers to my endpoints, and it works for some of them, but not all...
plusvictoria
1

votes
0

answer
1.5k

Views

No operations defined in spec! while specifying multiple paths in swagger ui

I want to display two REST API endpoints in Swagger ui: /cart and /post. When I specify either /cart or /post works fine but with both showing me error as No operations defined in spec! in swagger-ui @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestH...
Navin Gelot
1

votes
1

answer
402

Views

Swagger ui adds an additional /path in the testing page when behind zuul

I have several microservices behind a spring boot application embedding zuul, let's call it 'gateway'. Here's my config file: zuul: prefix: /api routes: api-login: path: /login/** url: http://localhost:8070/the-login/ api-other: ... I want to show the documentation for every service of mine in my ga...
Phate
1

votes
1

answer
407

Views

Swagger UI and ASP.NET - Mapping not found exception - can't access swagger UI page

I have created some ASP.NET Web API project in Visual Studio 2017 (.NET Framework 4.6.1). I enabled swagger UI using the SwaggerConfig.cs file. Everything worked fine, I could access the UI via http://localhost:54408/swagger/ui/index/. I wanted to go directly to this URL when the application starts...
Izi

View additional questions