swagger

swagger oauth security definition

不想你离开。 提交于 2019-12-08 11:04:51
问题 On my current webapi project I have set a swagger oauth security definition with implicit flow and authorize url https://login.microsoftonline.com/ + tenant Id. The scopes are the same as in the github exapmle for the Swashbuckle.AspNetCore nuget , this is the link https://github.com/domaindrivendev/Swashbuckle.AspNetCore. But when i try to authenticate on swagger online editor, this one https://editor.swagger.io/, I can't get the token back and get a 404 exception. What do I need to set in

Generating swagger docs from typescript interfaces

喜你入骨 提交于 2019-12-08 10:44:08
问题 I'm using swager-jsdoc to document all the DTOs of the app. I was wondering is there any way to generate the swagger docs automatically from typescript interfaces. I have a lot of them in the project and also a lot of mongoose schemas and models. It is getting tedious to keep them in sync. On the other hand I do not want to use the swagger generation tools. I prefer the bottom-up approach. Cheers 回答1: Yes, you can easily generate Swagger and OpenAPI documents from your TypeScript types by

How set SpringFox to show two (or more) versions of the Rest API using Spring Boot?

偶尔善良 提交于 2019-12-08 08:28:41
问题 I'm trying to figure out how manage two (or more) version of my API endpoints using Spring Fox. To version my APIs, I'm using the Versioning through content negotiation, also know as Versioning using Accept header. The versions of each endpoint are controlled individually using the header information. Per example, for the version one I use the attribute produces : @Override @PostMapping( produces = "application/vnd.company.v1+json") public ResponseEntity<User> createUser( For version two, I

Host Swagger UI 3.0 Dist folder using OWIN

南楼画角 提交于 2019-12-08 07:50:51
问题 I want to self-host the Swagger UI Dist folder on a Web Server using OWIN. I cannot use IIS to host Swagger UI. Most OWIN guides only talk about hosting Web API projects. How can I do that? The reason I want to do this is that I already have a separate project that generates the Open API/Swagger v3.0 schema docs. So I have the specs ready, I just need a way to host/show them on the Swagger UI. And this Swagger UI project needs to be self-hosted. See this - Add Swagger UI to a custom .NET Web

Change location to call swagger-ui in Spring

旧时模样 提交于 2019-12-08 06:26:25
How I can change location to call swagger api docs from http://localhost:8081/swagger-ui.html to http://localhost:8081/my-api-doc ? My SwaggerConfig is @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("com.package")) .paths(PathSelectors.any()) .build() .apiInfo(apiInfo()); } And I use springfox-swagger2 and springfox-swagger-ui both with version 2.7.0 . This is all I can did it. @Override public void addViewControllers(ViewControllerRegistry registry) {

Change the default package name in Swagger Editor for java project

非 Y 不嫁゛ 提交于 2019-12-08 06:18:59
问题 I have downloaded the Swagger Editor and run it locally from localhost:3001 . I imported my .yaml file from local system. Then I clicked on Generate Server and I choose a jaxrs . When I opened a random java file I can see: package io.swagger.model; I have more then 30 java classes and I don't want to change it manually, because my .yaml maybe change in future. Is there any possibility to change it, to be for example: package my.funny.package.model; //Edit: I downloaded Swagger Editor from

Swagger UI for Rails API using ActiveModel's Serializer

倾然丶 夕夏残阳落幕 提交于 2019-12-08 06:18:49
问题 I was wondering if anyone's done this before where they generate API docs using Swagger UI for an API not also generated by Swagger. Here's what a simple example of mine looks like: class Api::V1::UsersController < Api::V1::BaseController swagger_controller :users, 'Users' swagger_api :show do summary 'Returns a user' param :path, :id, :integer, :optional, "User Id" notes '/api/v1/users/:id' response :ok, "Success", :Users response :unauthorized response :not_acceptable response :not_found

open api 3 posting an array of files

回眸只為那壹抹淺笑 提交于 2019-12-08 05:57:32
问题 I am using swagger hub to create this API; but it doesn't support multi files in the UI so I am unsure if I am doing this right My goal is to have the following item:{Json describe the item} images[] = images for item posted as an array titles[] = Parallel array to images that has the title for image alt_texts[] = Parallel array to images that has the alt text for image This has to be multipart since it is files; but am unsure if I setup the structure correctly. Swagger/Open API Code post:

Static webpage on Nginx Docker Container Missing CSS

核能气质少年 提交于 2019-12-08 04:11:26
问题 I am trying to host the Swagger UI on a docker container using Nginx. When I access my webpage via hostAddress.com it returns the webpage as plain text and inspecting it tells me that it can't find any of the javascript or css files despite them seeming to be present in the container as I have ssh into the container to check. My dockerfile FROM nginx COPY src /usr/share/nginx/html COPY config/nginx.conf /etc/nginx EXPOSE 80 nginx.config events { worker_connections 4096; ## Default: 1024 }

strongloop, how to define a response class for a custom endpoint

☆樱花仙子☆ 提交于 2019-12-08 03:53:03
问题 According to the documentation you can create custom response classes; https://docs.strongloop.com/display/public/LB/Remote+methods#Remotemethods-Argumentdescriptions The remote method description I use is: common/models/products-sku.js ProductsSku.remoteMethod( 'getSomeData', { http: {path: '/getSomeData', verb: 'get'}, accepts: {arg: 'filter', type: 'object', http: { source: 'query'} }, returns: { arg: 'id', description: 'Custom endpoint', type: 'CustomProductType', root: true } } ); In the