For general support questions, please refer to the Community Forums.
This repository covers some of the pages at https://swagger.io - contributions are welcome.
The content of swagger.io
Home Page: http://swagger.io
For general support questions, please refer to the Community Forums.
This repository covers some of the pages at https://swagger.io - contributions are welcome.
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.
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.
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.
Steps to reproduce:
Expected Result: download of zip file with generated
Observed Result: "Unable to build target: Could not generate model [xxxxx]
Further observations:
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.
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
This repository is for issues related to the swagger.io website (http://swagger.io).
For general support issues around the Swagger/OpenAPI specification or the tooling provided by the Swagger ecosystem, please post your question in the google group at https://groups.google.com/forum/#!forum/swagger-swaggersocket.
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
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
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.
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.
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
When trying to start the npm server I am getting an error
Here are the steps I did to install:
brew install node
cd ~/NetbeansProjects
git clone http://github.com/swagger-api/swagger-editor.git
cd swagger-editor
npm start
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 ]
Hangs on uglify task after "npm start" on swagger-editor:
Running "uglify:sway" (uglify) task
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?
Hi Guys,
for http://online.swagger.io/validator/debug?url=http://my.own.domain/api.json
Note: JSON API is not valid for privacy purpose
I'm getting an internal error. Any idea from the logs on your side?
What is the correct way to add an http header using this API?
The links for 'open source projects' and 'commercial vendors' near the bottom of the file give 404s
???
@JsonIgnore
public String getPassword() {
return password;
}
@JsonProperty
public void setPassword(String password) {
this.password = password;
}
I would expect that the password property is shown for POST/PUT and hidden for GET. However the password property is hidden for both. Making what I assume is a fairly common configuration inaccurate.
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
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
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
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.
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?
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"
}
}
}
The ’Response Class (Status 200)’ section is generated on the webpage, with the correct Model Schema, but no description field.
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:
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:
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:
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:
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
In the swagger editor i get a model validation error when i have the same name
for a different parameter type variable?
'/services/{deviceType}/{language}':
- name: language
in: path
- name: language
in: header
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.
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:
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?
@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…)
any one help me ? for example api and command android studio. tks
It would be useful to have canonical URIs for JSON schemas for Swagger specifications.
I propose http://swagger.io/schemas/v{version}/schema.json (same path as in the swagger-spec repo).
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)
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.
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
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
I'm wondering if multiple yaml files supported? It means I can group different parts into different files. Thanks.
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
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?
Not sure if it's time yet.
It would be nice if it was possible to display NaN
values as the result of a request.
It's true that the JSON specification disallows number values such as NaN
(see specification). But the JavaScript specification allows these values as valid JavaScript values (see specification) and Swagger UI can already send JSON requests with NaN
in them.
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.
With the release of the M1 for Swagger 2.0 support, we should do the following:
/api-docs
on http://swagger.iohttp://petstore.swagger.wordnik.com/api/api-docs
requests to the new URLhttp://petstore.swagger.wordnik.com/v2/swagger.json
to the new URLhttp://petstore.swagger.wordnik.com/ui
and http://petstore.swagger.wordnik.com
to http://petstore.swagger.ioInvalid 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:...
This repository is for issues related to the swagger.io website (http://swagger.io).
For general support issues around the Swagger/OpenAPI specification or the tooling provided by the Swagger ecosystem, please post your question in the google group at https://groups.google.com/forum/#!forum/swagger-swaggersocket.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.