Git Product home page Git Product logo

swagger.io's Introduction

swagger.io's People

Contributors

andreatp avatar auscaster avatar calcinai avatar clarke68 avatar daviddenton avatar dmjio avatar domaindrivendev avatar earth2marsh avatar fehguy avatar furikuri avatar hjacobs avatar hkosova avatar honzajavorek avatar ivangoncharov avatar joelwurtz avatar jsdevel avatar kalinchernev avatar keshinpoint avatar lindybrandon avatar marcelojaloto avatar melnikalex avatar mohsen1 avatar ptariche avatar ricosuter avatar sergey-tihon avatar spoike avatar subeeshcbabu avatar tjwebb avatar toke avatar webron avatar

Stargazers

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

Watchers

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

swagger.io's Issues

No CONTRIBUTING.md

I'd like to contibute to this repo, but I'm not sure on where I should make a pull request to. I'm assuming the wordpress branch, as that is what I land on when following a link to the website, however it begs the question, what the gh-pages branch is for, if that's the case.

Adding a CONTRIBUTING.md file to the root of the repo would avoid any confusion about this. Plus you could add any other requirements you'd want those who attempt to make a PR to see. When you make a PR and the repo has a CONTRIBUTING.md, people will be informed that they should read it.

Swagger UI generates incorrect request when using the fields box

I am using swagger ui with content type = application/vnd.api+json.

If I use the UI for a GET, it generates the following:
curl -X GET --header 'Accept: application/vnd.api+json' 'http://107.170.10.170:16006/1/articles'
which is correct.

If I then use the UI for a GET with the fields box containing "[articles]=title" no quotes, it generates:
curl-X GET --header 'Accept: application/vnd.api+json''http://107.170.10.170:16006/1/articles?fields=%5Barticles%5D%3Dtitle'

This is not the correct format. IT SHOULD generate this:
curl -X GET --header 'Accept: application/vnd.api+json' 'http://107.170.10.170:16006/1/articles?fields%5Barticles%5D=title'

It should not add '=' after fields AND it should not encode the '=' before title.

Swagger Editor is sending my POST as a GET

I'm having trouble getting Swagger to send my request body as a raw JSON document using the "Try This Operation" feature. It keeps converting the JSON to a query string and sending the request as a GET, which my server rejects. I'm running locally, with the server on port 8080 and the editor on port 8081.

Here is my yaml:

paths:
/signup:
post:
description:
signup a user
parameters:
- in: body
name: json
description: The user signup details
required: true
schema:
$ref: '#/definitions/UserSignup'
responses:
200:
description: newly created user
schema:
properties:
status:
description: "status of the response"
type: string
enum: ['OK','Error']
result:
$ref: '#/definitions/UserBasic'

The UI is parsing it correctly, in that the UI displays the correct fields, and in the request preview it looks correct:

POST http://localhost:8080/api/noauth/v1/signup HTTP/1.1
Host: localhost
Accept: application/json
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,fa;q=0.6,sv;q=0.4
Cache-Control: no-cache
Connection: keep-alive
Origin: http://localhost:8081
Referer: http://localhost:8081/
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36
Content-Length: 101
Content-Type: application/json
{
"firstName": "Hank",
"lastName": "Zill",
"email": "[email protected]",
"password": "hank1"
}

However, when I execute the command, it's sent as a GET. Here is the Chrome console output:

Remote Address:127.0.0.1:8080
Request URL:http://localhost:8080/api/noauth/v1/signup?{%20%20%22firstName%22:%20%22Hank%22,%20%20%22lastName%22:%20%22Zill%22,%20%20%22email%22:%20%[email protected]%22,%20%20%22password%22:%20%22hank1%22}
Request Method:GET
Status Code:405 Method Not Allowed

I get the same error in Firefox. I assume there is something wrong with my definition, but I can't figure out what it is. I have tried setting the 'name' field in the parameters to 'body', but that doesn't help. I'm on Linux (Ubuntu 14.04), and using a version of the editor cloned from Github on August 1st.

Can not generate any java-based server from swagger editor live demo

Steps to reproduce:

  1. Go to live demo: http://editor.swagger.io/#/edit
  2. Click on "Generate Server"
  3. Select any java-based server (example: "JAX-RS")

Expected Result: download of zip file with generated

Observed Result: "Unable to build target: Could not generate model [xxxxx]

Further observations:

  1. this fails for most of the examples
  2. i can generate a java client
  3. i can generate every non-java-based server
  4. I have reproduced this on someone else laptop
  5. I have reproduced this on multiple browsers

Html5 Internet Explorer Issue

This is a small issue in the swagger-ui.

The default placeholder message displayed in the api parameter field box, such as '' or 'Provide multiple values in new lines' when the data type is string[] or other object values, the placeholder is not functioning, and the text become the value in the field box.

It happens with Internet Explorer and only when the data type is not string.

Maybe Internet Explorer is not supporting placeholder under some condition, but please provide other function that is supported by IE, when placeholder is not functioning. Thanks.

Swagger installation in windows and ubuntu

Hi guys,
I have problem in installing windows and ubuntu, i have gone through the documentation, tutorial and downloaded the folder in windows and ubuntu from repo respectively.
But I got lil confused. I need your help.

Would be gr8 if anyone can guide me.
Also, I would like to know about swagger API concept, where and how will i receive it?

I want to set up swagger in my localhost and want to put all my details of API there.

Regards,
Jyothi

Android issue

I am able to build swagger client, but while calling API I am getting Exception java.lang.ExceptionInInitializerError in APIInvoker class.
Let me know the solution how can I resolve this here is stacktrace.

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.Project31.api.FinalTestApi.(FinalTestApi.java:20)
at com.Project31.api.FinalTestApi.main(FinalTestApi.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.RuntimeException: Stub!
at org.apache.http.conn.ssl.SSLSocketFactory.(SSLSocketFactory.java:9)
at com.Project31.ApiInvoker$2.(ApiInvoker.java:425)
at com.Project31.ApiInvoker.initConnectionManager(ApiInvoker.java:425)
at com.Project31.ApiInvoker.(ApiInvoker.java:195)
at com.Project31.ApiInvoker.(ApiInvoker.java:58)
... 7 more

Examples not shown in formatted view

Hi, I've just been getting up to speed with Swagger. In my test I've attached an examples object to one of my methods. The editor seems to support this. However, the examples aren't shown in the formatted view. Is this not supported, or have I just not enabled something that controls this?

Thanks

missing download links on swagger ui page

http://swagger.io/swagger-ui/ says things like:

just clone this repo

but doesn't tell you what "this repo" is, or how to otherwise download it.

The documentation should provide links to where to download from as the very first thing in the download section. The github releases should probably be linked as well.

OAuth2.0 Flow in Swagger Spec

I am trying to add the Swagger API Spec my Oauth 2.0 API.

I am trying to add the Authorization in the header. Any one has any examples please share.

editor.swagger.io not responding to keystrokes or cut/copy/paste

I've got my YAML swagger document copied on my clipboard and am trying to paste it into the editor (on Chrome) and it won't paste. Also, simply trying to edit the default document that's there (deleting anything, typing anything) doesn't work.

JS console is logging the following errors:

Warn: could not find module util @ yaml.js:44

GET http://editor.swagger.io/mode-json.js @ index.js:3346 

Warn: could not find module util @ yaml.js:44

Uncaught TypeError: n.getMode(...).transformAction is not a function @ index.js:12183
        remove @ index.js:12183
        t.commands.exec @ index.js:11105
        (anonymous function) @ index.js:10506
        r._emit.r._dispatchEvent @ index.js:3399
        exec @ index.js:10534
        $callKeyboardHandlers @ index.js:4100
        onCommandKey @ index.js:4124
        onCommandKey @ index.js:12056
        r @ index.js:1648
        (anonymous function) @ index.js:1677

Uncaught TypeError: n.getMode(...).transformAction is not a function @ index.js:12183
        remove @ index.js:12183
        t.commands.exec @ index.js:11105
        (anonymous function) @ index.js:10506
        r._emit.r._dispatchEvent @ index.js:3399
        exec @ index.js:10534
        execCommand @ index.js:11981
        D @ index.js:2128
        B @ index.js:2149

Uncaught TypeError: r.transformAction is not a function @ index.js:11989
        insert @ index.js:11989
        $handlePaste @ index.js:11962
        t.commands.exec @ index.js:11014
        (anonymous function) @ index.js:10506
        r._emit.r._dispatchEvent @ index.js:3399
        exec @ index.js:10534
        onPaste @ index.js:11953
        R @ index.js:2198

Uncaught TypeError: n.replace is not a function @ ng-file-upload-all.js:2341
        p @ ng-file-upload-all.js:2341
        (anonymous function) @ ng-file-upload-all.js:2318

Uncaught TypeError: r.transformAction is not a function @ index.js:11989
        insert @ index.js:11989
        t.commands.exec @ index.js:11170
        (anonymous function) @ index.js:10506
        r._emit.r._dispatchEvent @ index.js:3399
        exec @ index.js:10534
        $callKeyboardHandlers @ index.js:4113
        onTextInput @ index.js:4128
        onTextInput @ index.js:12052
        D @ index.js:2140
        B @ index.js:2149

npm start not working

When trying to start the npm server I am getting an error

Here are the steps I did to install:

  1. Install node js: brew install node
  2. Go to your Netbeans Projects directory: cd ~/NetbeansProjects
  3. Checkout the swagger-editor: git clone http://github.com/swagger-api/swagger-editor.git
  4. Go into the project: cd swagger-editor
  5. Start the server: npm start
    *. ISSUE: Failed at the [email protected] start script 'grunt serve:dist'

Here is the npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart [email protected]
7 verbose unsafe-perm in lifecycle true
8 info start [email protected]
9 verbose unsafe-perm in lifecycle true
10 info [email protected] Failed to exec start script
11 verbose stack Error: [email protected] start: `grunt serve:dist`
11 verbose stack Exit status 1
11 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
11 verbose stack     at EventEmitter.emit (events.js:110:17)
11 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
11 verbose stack     at ChildProcess.emit (events.js:110:17)
11 verbose stack     at maybeClose (child_process.js:1015:16)
11 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
12 verbose pkgid [email protected]
13 verbose cwd /Users/cosborn/NetBeansProjects/swagger-editor
14 error Darwin 14.3.0
15 error argv "node" "/usr/local/bin/npm" "start"
16 error node v0.12.4
17 error npm  v2.10.1
18 error code ELIFECYCLE
19 error [email protected] start: `grunt serve:dist`
19 error Exit status 1
20 error Failed at the [email protected] start script 'grunt serve:dist'.
20 error This is most likely a problem with the swagger-editor-src package,
20 error not with npm itself.
20 error Tell the author that this fails on your system:
20 error     grunt serve:dist
20 error You can get their info via:
20 error     npm owner ls swagger-editor-src
20 error There is likely additional logging output above.
21 verbose exit [ 1, true ]

Define schemas for error responses?

I've been using swagger since I discovered it via .NET's ServiceStack framework back in 2013, and love it. Thanks.

Is there a way to define, in an API-wide way, response schemas for errors? For example, classically 400 Bad Request is used when a request cannot be processed, either because of some validation failure, or because of some business rule not being true. I created justeat/JE.ApiValidation to help us be consistent with our APIs - it's a little validation helper whose main benefit is standardising the response body that our APIs return (not that we've migrated everything to that yet!).

Is there a way to publish the same sort of contract rules via swagger - like, a space for cross-operation rules?

HTTP Header

What is the correct way to add an http header using this API?

listing apis is wrong

I have apis from different name spaces and I am forced to set c.UseFullTypeNameInSchemaIds();
because I have same entity names in different names spaces.

suppose I have the following apis
A.Api.GetData1
B.Api.GetData2

When swagger lists in swagger ui, I get this result
A.Api.GetData1
A.Api.GetData2
B.Api.GetData1
B.Ap.GetData2

Kindly help.

Thanks
Jithin

Error Creating Bean config

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanConfig' defined in class path resource [spring-ws-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'scan' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/constraints/Size
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'scan' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/constraints/Size
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)
... 26 more

swagger-jaxrs version 1.5.7 ServeletConfig is null when ApiListingResource.getListing

Yesterday I tried to upgrade swagger-jaxrs to lastest version (1.5.7) but when I requested my swagger endpoint: http://localhost:7070/resources/swagger

Then I got the follwoing exception:
11:49:00.739 [http-nio-7070-exec-8] ERROR o.a.c.i.AbstractFaultChainInitiatorObserver - Error occurred during error handling, give up! org.apache.cxf.interceptor.Fault: null at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) ~[cxf-core-3.1.5.jar:3.1.5] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) ~[cxf-core-3.1.5.jar:3.1.5] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5] at org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68) ~[openejb-cxf-rs-7.0.0-M2.jar:7.0.0-M2] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) ~[cxf-core-3.1.5.jar:3.1.5] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) ~[cxf-core-3.1.5.jar:3.1.5] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[cxf-core-3.1.5.jar:3.1.5] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.1.5.jar:3.1.5] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:253) [cxf-rt-transports-http-3.1.5.jar:3.1.5] at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:237) [openejb-cxf-rs-7.0.0-M2.jar:7.0.0-M2] at org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94) [tomee-jaxrs-7.0.0-M2.jar:7.0.0-M2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.32] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.32] at org.apache.openejb.server.httpd.WebBeansFilter.doFilter(WebBeansFilter.java:52) [openejb-http-7.0.0-M2.jar:7.0.0-M2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.32] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.32] at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:205) [rewrite-servlet-2.0.12.Final.jar:2.0.12.Final] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.32] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.32] at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:201) [javamelody-1.59.0.jar:na] at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178) [javamelody-1.59.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.32] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.32] at org.omnifaces.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:122) [omnifaces-2.2.jar:2.2] at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:108) [omnifaces-2.2.jar:2.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.32] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.32] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [catalina.jar:8.0.32] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.32] at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44) [tomee-catalina-7.0.0-M2.jar:7.0.0-M2] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.32] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.32] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.32] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.32] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.32] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [catalina.jar:8.0.32] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-coyote.jar:8.0.32] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-coyote.jar:8.0.32] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) [tomcat-coyote.jar:8.0.32] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) [tomcat-coyote.jar:8.0.32] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.32] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72] Caused by: java.lang.NullPointerException: null at io.swagger.jaxrs.config.SwaggerContextService.isScannerIdInitParamDefined(SwaggerContextService.java:236) ~[swagger-jaxrs-1.5.7.jar:1.5.7] at io.swagger.jaxrs.listing.ApiListingResource.process(ApiListingResource.java:101) ~[swagger-jaxrs-1.5.7.jar:1.5.7] at io.swagger.jaxrs.listing.ApiListingResource.getListingJson(ApiListingResource.java:154) ~[swagger-jaxrs-1.5.7.jar:1.5.7] at io.swagger.jaxrs.listing.ApiListingResource.getListing(ApiListingResource.java:141) ~[swagger-jaxrs-1.5.7.jar:1.5.7] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_72] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_72] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_72] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_72] at org.apache.openejb.server.cxf.rs.PojoInvoker.performInvocation(PojoInvoker.java:43) ~[openejb-cxf-rs-7.0.0-M2.jar:7.0.0-M2] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.1.5.jar:3.1.5] ... 43 common frames omitted

I checked the sources and I saw that ServeletConfig is null when swagger try to call ApiListingResource.getListing(...)

Any idea?

I'm using swagger with a JavaEE 7 rest service with CXF into Tomee 7.0.0-M2.

Thanks

Exclude model tests?

The new test generation stuff in 2.1.6 is nice (using csharp). Is there a way to exclude the generation of model tests though? I'm only wanting tests generated for the Api classes.

How to use cookie to send authentication in POST by curl

I want run the simple test for the API doc that generated by swagger-ui in python.
How can I get cookie and use cookie to save & use the authentication in curl command?
I read a little projects in python but found there is no sample.

could you please to give some suggestion or sample for this?

The details of the succesfull API call (response: HTTP 200) is not shown in the Response Messages table

I have a swagger.json file which contains a swagger 2.0 conform content.

The swagger.json file contains the following 3 responses. The ’Response Messages’ table in the generated html does not show a row with the information for the success case, see attached image.

        "responses" : {
          "200" : {
            "description" : "Details about the response in case of success.",
            "schema" : {
              "$ref" : "#/definitions/ResponseBody"
            }
          },
          "400" : {
            "description" : "There is an error in the specified request body.",
            "schema" : {
              "$ref" : "#/definitions/ResponseBody"
            }
          },
          "401" : {
            "description" : "The user is not authorized to perform the action.",
            "schema" : {
              "$ref" : "#/definitions/ResponseBody"
            }
          }
        }

missingresponse200

The ’Response Class (Status 200)’ section is generated on the webpage, with the correct Model Schema, but no description field.

Proposal: Categories and tags for Swagger projects

I've got a proposal for categorizing the available Swagger tools and libraries. Technically I guess that content is part of swagger-spec's README right now, but I think it makes sense to discuss it here because:

  1. Most people will find it the link on swagger.io
  2. It probably makes sense to move that content to swagger.io, especially if you want a more advanced list (like the MiddlemanApp directory, which as tags like "Official" vs "Community" and supports searching and filtering)

In answer on quora related to WADL, but noting that Swagger serves a similar purpose, Gregory Brail of Apigee wrote that it could be used to:

  • Generate readable, good-looking documentation
  • Present an easy-to-use API test console
  • Automatically generate test cases
  • Automatically generate a client-side SDK

He also wrote:

Otherwise, the only way for a tool do to these things is to introspect the source.

I think that's a pretty good start for thinking about how to categorize the existing Additional Libraries for Swagger. The last statement about "introspecting the source" isn't a use for swagger itself but is a characteristic of some Swagger libraries/tools: projects that introspect source in order to generate a Swagger contract. Basically a code generator in reverse - or a "Swagger generator".

In the long run I think tagging libraries will work better than listing, so I'd propose these tags for libraries/tools that are similar to the categories above:

  • Documentation
  • API Console
  • Testing
  • Code generator
  • Swagger generator

Perhaps API Console is a subcategory of documentation. It may also make sense to have "Parser" and/or "Validator", which seem to be the common categories for the lower-level libraries.

Additionally it makes sense to tag things by:

  • Supported Swagger version(s)
  • Interface (e.g. Programming language)

I wrote interface rather than programming language because people may be more interested in how than can talk to a library than how it was implemented. In most cases that's through the language (Ruby, JavaScript, etc), but sometimes its a common interface for a family of languages (.NET CLR, JVM) and other times it might be a language-agnostic interface (e.g. "HTTP" for projects that just launch a stub server for an API, or "CLI" for projects like signalfx/swagger-cli-client).

So, for example, we might associate metadata like this with a project:

flask-restful-swagger:
  categories:
    - Swagger generator
  interface:
    - Python
  swagger_support:
    - 2.0
    - 1.2

Create a CORS proxy for swagger.io

The CORS proxy should satisfy the needs of the editor and the ui so that people won't need to spin up their own solutions for the online versions.

The server should be limited to requests from swagger.io's subdomains to reduce chances for abuse.

@mohsen1 - fyi.

Swagger Tools and Integrations could do with a Table of Contense

I was thinking that the Tools and Intergrations page could do with a table of contense.

I looked into making a pull request on the markdown file, but I don't know how it's being intergrated into wordpress.

I think this would also be hugely benifical for the specification page.

It's frustrating to:

  1. Not have a table of contense
  2. Not be able to link directly to a section of the page.

Github adds links to every header tag. Would this be something that could be added automatically to the spec and other pages on the Swagger site?

Remove master branch and leave only the gh-pages

@fehguy can you remove master and leave just gh-pages?

And then can you make sure it's set up to serve up a github.io site?

Not sure how it's addressable when there is a dot in the title. Maybe change the repo name, too?

(and I've stubbed out some content…)

org.springframework.beans.factory.BeanCreationException

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; ne
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:183)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)

Variable names truncated

The definition is:

       properties:
          DocHead:
             type: object
             $ref: '#definitions/DocHeaders'
          DecSections:
             type: object
             $ref: '#/definitions/DocSections'```

The model that is being referenced is defined as:

```DocHeaders: 
    properties:
      DocuemntTitle:
        type: string
        description: The title of this document. 

The error generated reads:

Docheader could not be resolved: #definitions/DocHeaders

This breaks the documentation and it stops it from rendering.

screen shot 2015-08-24 at 8 00 32

Wanna use swagger for websocket without REST

Hi guys. I try to use swagger for my project. I've got the problem. The thing is that I'm do not need REST at all. All my requests do not use GET, POST or whatever request statuses. My API uses clean websocket. Totally asynchronous nature.

So my question is: how to adopt swagger for my needs. What I need to rewrite/override? or better write some plugin for it?

For example: I don't want to specify my request examples like that:

path: /api_call
get: some get request

Because I dot not use REST(no any GET, POST, ..., etc.). I want to specify it something like that:

endpoint: /api_call
request: describe what client can send
response: describe what client can receive

I noticed in specification that there are schemes available: ws, wss.. But its not documented very well..

So my question is: What are your plans to support NON-REST API, because it becomes very popular. For mobile for example.

Will be glad to speak with some swagger developer or whoever. Because I can implement some module or whatever and share it for public use. But help from swagger development team is appreciated.

Thank you in advance,
Artem

Proposal: Support LINK and UNLINK HTTP methods

Hi,
I working on an app which has a REST interface where I use LINK and UNLINK HTTP methods to send messages. I would like to use swagger for documentation purposes, but unfortunately it does not support these two method types.
Have you considered the support of these?

Regards,
Grunci

Are multiple files supported

I'm wondering if multiple yaml files supported? It means I can group different parts into different files. Thanks.

All ids and names are missing in swagger spec html

From @jvivs on April 29, 2016 15:8

Swagger.io is currently the place where most of my coworkers go to read the OpenAPI spec and the linking structure appears to have changed. It's frustrating to have links break, especially when you're trying to link to someone in a document as long as this one: http://swagger.io/specification/

Is it possible to add github-style linking to headers like the markdown file has on github? Also if there are anchors internally in the document, can we have an index or at least put some text in them so they can be found without having to view the source code?

I can open a PR if it is welcome.

Copied from original issue: OAI/OpenAPI-Specification#675

Comments and whitespace are stripped when loading a yaml file

I develop a spec using the swagger editor, and add comments and additional blank lines for clarity. I then export this spec to my system. If I then reload this spec the editor strips out all the comments and blank lines. And if I reexport the spec I will then lose these comments. At present I'm having to import the document, open it in an external editor and then copy/paste the original text into swagger-editor. Has the stripping out of comments been done deliberately, or is this a bug?

swagger-jersey-jaxrs 1.5.0 generates invalid JSON according to json-schema draft-04 when XmlRootElement annotation is used

When a class has a javax.xml.bind.annotation.XmlRootElement annotation on it, e.g.

@XmlRootElement(name = "episodes")
@XmlAccessorType(XmlAccessType.FIELD)
public class RokuEpisodes { ... }

Swagger will put an 'xml' element in that object's schema definition, which is invalid, e.g.

"RokuEpisodes": {
    "type": "object",
    "properties": {
        "rokuEpisodes": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/RokuEpisode"
            }
        }
    },
    "xml": {
        "name": "episodes"
    }
},

This breaks JSON schema validation according to json-schema draft 04 (http://json-schema.org/draft-04/schema#). This is a problem because aws-apigateway-swagger-importer is using this schema to validate the swagger.json and import it.

Petstore migration to swagger.io

With the release of the M1 for Swagger 2.0 support, we should do the following:

  • Host the 1.2 /api-docs on http://swagger.io
  • Redirect http://petstore.swagger.wordnik.com/api/api-docs requests to the new URL
  • Host the 2.0 pet store on http://swagger.io
  • Redirect http://petstore.swagger.wordnik.com/v2/swagger.json to the new URL
  • Host the M1 UI on http://petstore.swagger.io
  • Redirect http://petstore.swagger.wordnik.com/ui and http://petstore.swagger.wordnik.com to http://petstore.swagger.io
  • Update link on http://swagger.io
  • Update links on the other projects - swagger-js, swagger-ui, swagger-core, swagger-codegen, swagger-node-express.

Some requests fault the server

Invalid request example:

POST /pet

{
  "id": 0,
}

->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /v2/pet. Reason:...

Valid but failing request:

POST /user

{
  "id": 0,
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "password": "string",
  "phone": "string",
  "userStatus": 0
}

->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /v2/user. Reason:...

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.