Giter Site home page Giter Site logo

springfox-swagger-ui-rfc6570's Introduction

springfox-swagger-ui
  • Creates a webjar containing the swagger-ui static content.
  • Adds a JSON endpoint /swagger-resources which lists all of the swagger resources and versions configured for a given application.

Prior versions of this library included sdoc.jsp which caused all kinds of problems on spring boot. This latest version now bundles a html (swagger-ui.html) instead.

The swagger ui version is specified in ./build.gradle where swaggerUiVersion is a git tag on the [swagger-ui repo] (https://github.com/swagger-api/swagger-ui).

  • All content is served from a webjar convention, relative url taking the following form: webjars/${project.name}/${project.version} e.g: /webjars/springfox-swagger-ui/<YOUR-SPRINGFOX-VERSION>/swagger-ui .html

By default Spring Boot has sensible defaults for serving content from webjars. To configure vanilla spring web mvc apps to serve webjar content see the [webjar documentation] (http://www.webjars.org/documentation#springmvc)

Releasing swagger-ui
./gradlew clean build bintrayUpload -PbintrayUsername=<user> -PbintrayApiKey=<key> -PossUser=<sonatype-user> -PossPassword=<sonatype-pwd>

springfox-swagger-ui-rfc6570's People

Contributors

adrianbk avatar dilipkrish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

springfox-swagger-ui-rfc6570's Issues

OAuth configuration gets ignored when clientSecret is an empty string

Because the empty string is a falsey value in JavaScript and the clientSecret is checked in https://github.com/springfox/springfox-swagger-ui-rfc6570/blob/master/src/web/js/springfox.js#L70, the OAuth configuration is ignored when no clientSecret is provided.

This has already been fixed in https://github.com/springfox/springfox (see springfox/springfox#1592)

In my case the OAuth Provider (Keycloak Server) simply ignores client secrets for non-confidential clients so I can put in a random clientSecret as a workaround.

rest call to download zip file, downloads corrupted zip file

Hi,

Rest call has now problem downloading zip file in browser URL.

With swagger-ui, downloading zip file with extra underscore appended to filename in prefix and suffix (of extension) _XXXApplication-1524222675972.zip_ and its corrupt. Can you please address this issue?

Response header as following:
{
"pragma": "no-cache",
"date": "Fri, 20 Apr 2018 11:11:21 GMT",
"access-control-allow-headers": "Content-Type, attachment",
"content-type": "application/octet-stream",
"access-control-allow-origin": "*",
"cache-control": "no-cache, no-store, must-revalidate",
"content-disposition": "attachment; filename="XXXApplication-1524222675972.zip"",
"attachment": "XXXApplication-1524222675972.zip",
"content-length": "6415",
"expires": "Thu, 01 Jan 1970 00:00:00 GMT"
}

swagger dependencies:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>

Please let me know if requires more details.

Thanks

On execute, swagger-ui doubles the query parameters

I enabledUrlTemplate(ing) in my docket config and switched the UI to this one. The overloaded get methods I have display properly, however the swagger UI looks like it's doubling query parameters after clicking the Execute button;

http://localhost:8080/resources/transforms?name=test&name=test

This succesfully calls the correct Spring controller method but with value "test,test";

    @CrossOrigin
    @RequestMapping(method = RequestMethod.GET, params = {"name"})
    @ResponseBody
    public Page<M> findByName(@RequestParam String name, Pageable pageable) {
        return repository.findByName(name, pageable, MAX_DEPTH);
    }

I've confirmed that a direct call to the url
http://localhost:8080/resources/transforms?name=test
works as intended.

How to get swagger definition?

Link to v2/api-docs shows browser error probably because in response it sends Content-Type: application/xhtml+xml;charset=UTF-8.

With springfox-swagger-ui the link works fine maybe because it sends Content-Type: application/json;charset=UTF-8

java.lang.NumberFormatException: For input string: ""

This dependency (1.0.0) works with io.springfox:springfox-swagger2 version 2.7.0 and 2.8.0, but not with 2.9.0 onwards.

2.9.x throws the following exception:-

java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_171]
	at java.lang.Long.parseLong(Long.java:601) ~[na:1.8.0_171]
	at java.lang.Long.valueOf(Long.java:803) ~[na:1.8.0_171]
	at io.swagger.models.parameters.AbstractSerializableParameter.getExample(AbstractSerializableParameter.java:412) ~[swagger-models-1.5.20.jar:1.5.20]
	at sun.reflect.GeneratedMethodAccessor203.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:664) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:689) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:689) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:689) [jackson-databind-2.8.10.jar:2.8.10]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) [jackson-databind-2.8.10.jar:2.8.10]

Supporting Multi line

Can you add a feature to have multi line request parameters like the following that presents it as multi line text area?

@ApiParam(value="Message", required=true, multiLine=true)

If there is already one available can you please point me on how to achieve this?

Distribution

I'd like to make a few minor customizations to to the swagger-ui.js that are specific to my application. Is it possible to get this package in a format that I can just add to my /static folder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.