library-example-with-ext.json 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "Google Example Library API",
  5. "description": "A simple Google Example Library API.",
  6. "version": "v1"
  7. },
  8. "host": "library-example.googleapis.com",
  9. "x-sampleone-book" : {"code": 123, "message": 999},
  10. "x-sampleone-shelf" : {"foo1": 123, "bar": 999},
  11. "x-sampleone-mysimplestring" : "hello world",
  12. "x-sampleone-mysimpleint64" : 12345,
  13. "x-sampleone-mysimplenumber" : 111.222,
  14. "x-sampleone-mysimpleboolean" : true,
  15. "x-sampletwo-book" : {"code": 123, "message": 999},
  16. "x-sampletwo-shelf" : {"foo1": 123, "bar": 999},
  17. "x-unhandled" : {"code": 123, "message": 999},
  18. "parameters" : {
  19. "paramAtSwaggerScope": {
  20. "name": "paramAtSwaggerScope",
  21. "in": "query",
  22. "description": "test",
  23. "required": true,
  24. "type": "integer",
  25. "format": "int32"
  26. }
  27. },
  28. "paths": {
  29. "/v1/{sharedParameter}/pets": {
  30. "post": {
  31. "operationId": "simpleMethod",
  32. "parameters": [
  33. {
  34. "name": "myBodyRef",
  35. "in": "body",
  36. "schema": {
  37. "properties": {
  38. "myStringA": {
  39. "type": "string"
  40. }
  41. }
  42. }
  43. },
  44. {
  45. "name": "paramToOverride",
  46. "in": "query",
  47. "description": "New description",
  48. "required": true,
  49. "type": "string"
  50. },
  51. {
  52. "$ref": "#/parameters/paramAtSwaggerScope"
  53. }
  54. ],
  55. "responses": {
  56. "default": {
  57. "description": "successful operation",
  58. "schema": {
  59. "$ref": "#/definitions/SimpleDef"
  60. }
  61. }
  62. }
  63. },
  64. "parameters": [
  65. {
  66. "name": "sharedParameter",
  67. "in": "path",
  68. "description": "Shared parameter",
  69. "required": true,
  70. "type": "string"
  71. },
  72. {
  73. "name": "paramToOverride",
  74. "in": "query",
  75. "description": "Description to override",
  76. "required": true,
  77. "type": "string"
  78. }
  79. ]
  80. }
  81. },
  82. "definitions": {
  83. "SimpleDef": {
  84. "properties": {
  85. "myStringA": {
  86. "type": "string"
  87. }
  88. }
  89. }
  90. }
  91. }