Advertisement
Guest User

Untitled

a guest
May 26th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. swagger: '2.0'
  2.  
  3. info:
  4. version: "0.0.1"
  5. title: Localised Thingy demonstration
  6.  
  7. definitions:
  8. translation:
  9. required:
  10. - default
  11. properties:
  12. default:
  13. type: string
  14. additionalProperties:
  15. type: string
  16.  
  17. thingy:
  18. required:
  19. - code
  20. properties:
  21. code:
  22. type: string
  23. translations:
  24. $ref: '#/definitions/translation'
  25.  
  26. localisedThingy:
  27. required:
  28. - code
  29. - name
  30. properties:
  31. code:
  32. type: string
  33. description: A locale code
  34. pattern: '^[a-z]{2}(\|[a-z]+)?$'
  35. name:
  36. type: string
  37. description: The localised name
  38. paths:
  39. /thingies:
  40. get:
  41. description: |-
  42. Gets `Thingy` objects.
  43. responses:
  44. # Response code
  45. 200:
  46. description: A bunch of `Thingies`
  47. schema:
  48. type: array
  49. items:
  50. $ref: '#/definitions/thingy'
  51. /{locale}/thingies:
  52. get:
  53. description: |-
  54. Gets correctly localised `Thingies`
  55. parameters:
  56. - name: locale
  57. in: path
  58. type: string
  59. required: true
  60. default: default
  61. responses:
  62. 200:
  63. description: A bunch of localised `Thingies`
  64. schema:
  65. type: array
  66. items:
  67. $ref: '#/definitions/localisedThingy'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement