Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

vor 13 Jahren
vor 12 Jahren
vor 13 Jahren
vor 12 Jahren
vor 13 Jahren
vor 13 Jahren
vor 12 Jahren
vor 12 Jahren
vor 13 Jahren
vor 12 Jahren
vor 13 Jahren
vor 12 Jahren
vor 13 Jahren
vor 12 Jahren
vor 12 Jahren
vor 12 Jahren
vor 12 Jahren
vor 12 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Swagger UI
  2. ==========
  3. Swagger UI is part of [Swagger](http://swagger.wordnik.com/) project. The Swagger project allows you to produce, visualize and consume your OWN RESTful
  4. services. No proxy or 3rd party services required. Do it your own way.
  5. Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically
  6. generate beautiful documentation and sandbox from a [Swagger-compliant](https://github.com/wordnik/swagger-core/wiki) API. Because Swagger UI has no
  7. dependencies, you can host it in any server environment, or on your local machine.
  8. How to Use It
  9. -------------
  10. ### Download
  11. You can use the swagger-ui code AS-IS! No need to build or recompile--just [download](https://github.com/wordnik/swagger-ui/downloads) the distribution,
  12. unpack and start using it. If you like swagger-ui as-is, stop here.
  13. ### Build
  14. You can rebuild swagger-ui on your own to tweak it or just so you can say you did. To do so, follow these steps:
  15. 1. Install [CoffeeScript](http://coffeescript.org/#installation) which will give you [cake](http://coffeescript.org/#cake)
  16. 2. Run cake dist
  17. 3. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser
  18. ### Use
  19. Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.wordnik.com/api/resources.json) service and show its APIs.
  20. You can enter your own server url and click explore to view the API.
  21. ### Customize
  22. You may choose to customize Swagger UI for your organization. Here is an overview of what the various directories contain
  23. - dist: Contains a distribution which you can deploy on a server or load from your local machine.
  24. - bin: Contains files used by swagger-ui for its build/test. These are not required by the distribution.
  25. - lib: Contains javascript dependencies which swagger-ui depends on
  26. - node_modules: Contains node modules which swagger-ui uses for its development.
  27. - src
  28. - src/main/coffeescript: main code in CoffeeScript
  29. - src/main/templates: [handlebars](http://handlebarsjs.com/) templates used to render swagger-ui
  30. - src/main/html: the html files, some images and css
  31. - src/main/javascript: some legacy javascript referenced by CofffeeScript code
  32. ### SwaggerUi
  33. To use swagger-ui you should take a look at the [source of swagger-ui html page](https://github.com/wordnik/swagger-ui/tree/master/src/main/html) and customize it. This basically requires you to instantiate a SwaggerUi object and call load() on it as below:
  34. ```javascript
  35. window.swaggerUi = new SwaggerUi({
  36. discoveryUrl:"http://petstore.swagger.wordnik.com/api/resources.json",
  37. dom_id:"swagger-ui-container",
  38. apiKey:"special-key",
  39. supportHeaderParams: false,
  40. supportedSubmitMethods: ['get', 'post', 'put']
  41. });
  42. window.swaggerUi.load();
  43. ```
  44. * *discoveryUrl* parameter should point to a resource listing url as per [Swagger Spec](https://github.com/wordnik/swagger-core/wiki)
  45. * *dom_id parameter* is the the id of a dom element inside which SwaggerUi will put the user interface for swagger
  46. * All other parameters are explained in greater detail below
  47. ### HTTP Methods and API Invocation
  48. swagger-ui supports invocation of all HTTP methods APIs but only GET methods APIs are enabled by default. You can choose to enable other HTTP methods like POST, PUT and DELETE. This can be enabled by [setting the supportedSubmitMethods parameter when creating SwaggerUI instance](https://github.com/wordnik/swagger-ui/blob/f2e63c65a759421aad590b7275371cd0c06c74ea/src/main/html/index.html#L49).
  49. For example if you wanted to enable GET, POST and PUT but not for DELETE, you'd set this as:
  50. supportedSubmitMethods: ['get', 'post', 'put']
  51. _Note that for POST/PUT body, you'd need to paste in the request data in an appropriate format which your service can unmarshall_
  52. ### Header Parameters
  53. header parameters are supported. However because of [Cross-Origin Resource Sharing](http://www.w3.org/TR/cors/) restrictions, swagger-ui, by default, does not send header parameters. This can be enabled by [setting the supportHeaderParams to true when creating SwaggerUI instance](https://github.com/wordnik/swagger-ui/blob/f2e63c65a759421aad590b7275371cd0c06c74ea/src/main/html/index.html#L48) as below:
  54. supportHeaderParams: true
  55. ### Api Key Parameter
  56. If you enter an api key in swagger-ui, it sends a parameter named 'api\_key' as a query (or as a header param if you've enabled it as described above). You may not want to use the name 'api\_key' as the name of this parameter. You can change its name by setting the _apiKeyName_ parameter when you instantiate a SwaggerUI instance. For example to call it 'sessionId'
  57. apiKeyName: "sessionId"
  58. How to Improve It
  59. -----------------
  60. Create your own fork of [wordnik/swagger-ui](https://github.com/wordnik/swagger-ui)
  61. To share your changes, [submit a pull request](https://github.com/wordnik/swagger-ui/pull/new/master).
  62. License
  63. -------
  64. Copyright 2011-2012 Wordnik, Inc.
  65. Licensed under the Apache License, Version 2.0 (the "License");
  66. you may not use this file except in compliance with the License.
  67. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
  68. Unless required by applicable law or agreed to in writing, software
  69. distributed under the License is distributed on an "AS IS" BASIS,
  70. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  71. See the License for the specific language governing permissions and
  72. limitations under the License.