swapi.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. export const schema = {
  2. people: {
  3. "description": "A person within the Star Wars universe",
  4. "type": "object",
  5. "required": [
  6. "name",
  7. "height",
  8. "mass",
  9. "hair_color",
  10. "skin_color",
  11. "eye_color",
  12. "birth_year",
  13. "gender",
  14. "homeworld",
  15. "films",
  16. "species",
  17. "vehicles",
  18. "starships",
  19. "url"
  20. ],
  21. "properties": {
  22. "url": {
  23. "description": "The url of this resource",
  24. "type": "string"
  25. },
  26. "homeworld": {
  27. "description": "The url of the planet resource that this person was born on.",
  28. "type": "string"
  29. },
  30. "vehicles": {
  31. "description": "An array of vehicle resources that this person has piloted",
  32. "type": "array"
  33. },
  34. "films": {
  35. "description": "An array of urls of film resources that this person has been in.",
  36. "type": "array"
  37. },
  38. "starships": {
  39. "description": "An array of starship resources that this person has piloted",
  40. "type": "array"
  41. },
  42. "height": {
  43. "description": "The height of this person in meters.",
  44. "type": "string"
  45. },
  46. "skin_color": {
  47. "description": "The skin color of this person.",
  48. "type": "string"
  49. },
  50. "birth_year": {
  51. "description": "The birth year of this person. BBY (Before the Battle of Yavin) or ABY (After the Battle of Yavin).",
  52. "type": "string"
  53. },
  54. "eye_color": {
  55. "description": "The eye color of this person.",
  56. "type": "string"
  57. },
  58. "hair_color": {
  59. "description": "The hair color of this person.",
  60. "type": "string"
  61. },
  62. "gender": {
  63. "description": "The gender of this person (if known).",
  64. "type": "string"
  65. },
  66. "name": {
  67. "description": "The name of this person.",
  68. "type": "string"
  69. },
  70. "species": {
  71. "description": "The url of the species resource that this person is.",
  72. "type": "array"
  73. },
  74. "mass": {
  75. "description": "The mass of this person in kilograms.",
  76. "type": "string"
  77. }
  78. },
  79. "title": "People",
  80. "$schema": "http://json-schema.org/draft-04/schema"
  81. },
  82. planets: {
  83. "description": "A planet.",
  84. "type": "object",
  85. "required": [
  86. "name",
  87. "rotation_period",
  88. "orbital_period",
  89. "diameter",
  90. "climate",
  91. "gravity",
  92. "terrain",
  93. "surface_water",
  94. "population",
  95. "residents",
  96. "films",
  97. "created",
  98. "edited",
  99. "url"
  100. ],
  101. "properties": {
  102. "gravity": {
  103. "description": "A number denoting the gravity of this planet. Where 1 is normal.",
  104. "type": "string"
  105. },
  106. "population": {
  107. "description": "The average populationof sentient beings inhabiting this planet.",
  108. "type": "string"
  109. },
  110. "diameter": {
  111. "description": "The diameter of this planet in kilometers.",
  112. "type": "string"
  113. },
  114. "terrain": {
  115. "description": "the terrain of this planet. Comma-seperated if diverse.",
  116. "type": "string"
  117. },
  118. "url": {
  119. "description": "The hypermedia URL of this resource.",
  120. "type": "string"
  121. },
  122. "edited": {
  123. "description": "the ISO 8601 date format of the time that this resource was edited.",
  124. "type": "string"
  125. },
  126. "orbital_period": {
  127. "description": "The number of standard days it takes for this planet to complete a single orbit of its local star.",
  128. "type": "string"
  129. },
  130. "surface_water": {
  131. "description": "The percentage of the planet surface that is naturally occuring water or bodies of water.",
  132. "type": "string"
  133. },
  134. "created": {
  135. "description": "The ISO 8601 date format of the time that this resource was created.",
  136. "type": "string"
  137. },
  138. "residents": {
  139. "description": "An array of People URL Resources that live on this planet.",
  140. "type": "array"
  141. },
  142. "climate": {
  143. "description": "The climate of this planet. Comma-seperated if diverse.",
  144. "type": "string"
  145. },
  146. "name": {
  147. "description": "The name of this planet.",
  148. "type": "string"
  149. },
  150. "rotation_period": {
  151. "description": "The number of standard hours it takes for this planet to complete a single rotation on its axis.",
  152. "type": "string"
  153. },
  154. "films": {
  155. "description": "An array of Film URL Resources that this planet has appeared in.",
  156. "type": "array"
  157. }
  158. },
  159. "title": "Planet",
  160. "$schema": "http://json-schema.org/draft-04/schema"
  161. },
  162. films: {
  163. "description": "A Star Wars film",
  164. "type": "object",
  165. "required": [
  166. "title",
  167. "episode_id",
  168. "opening_crawl",
  169. "director",
  170. "producer",
  171. "release_date",
  172. "characters",
  173. "planets",
  174. "starships",
  175. "vehicles",
  176. "species",
  177. "url"
  178. ],
  179. "properties": {
  180. "producer": {
  181. "description": "The producer(s) of this film.",
  182. "type": "string"
  183. },
  184. "vehicles": {
  185. "description": "The vehicle resources featured within this film.",
  186. "type": "array"
  187. },
  188. "url": {
  189. "description": "The url of this resource",
  190. "type": "string"
  191. },
  192. "release_date": {
  193. "description": "The release date at original creator country.",
  194. "type": "date"
  195. },
  196. "opening_crawl": {
  197. "description": "The opening crawl text at the beginning of this film.",
  198. "type": "string"
  199. },
  200. "title": {
  201. "description": "The title of this film.",
  202. "type": "string"
  203. },
  204. "characters": {
  205. "description": "The people resources featured within this film.",
  206. "type": "array"
  207. },
  208. "starships": {
  209. "description": "The starship resources featured within this film.",
  210. "type": "array"
  211. },
  212. "planets": {
  213. "description": "The planet resources featured within this film.",
  214. "type": "array"
  215. },
  216. "episode_id": {
  217. "description": "The episode number of this film.",
  218. "type": "integer"
  219. },
  220. "director": {
  221. "description": "The director of this film.",
  222. "type": "string"
  223. },
  224. "species": {
  225. "description": "The species resources featured within this film.",
  226. "type": "array"
  227. }
  228. },
  229. "title": "Film",
  230. "$schema": "http://json-schema.org/draft-04/schema"
  231. },
  232. species: {
  233. "description": "A species within the Star Wars universe",
  234. "type": "object",
  235. "required": [
  236. "name",
  237. "height",
  238. "mass",
  239. "hair_color",
  240. "skin_color",
  241. "eye_color",
  242. "birth_year",
  243. "gender",
  244. "homeworld",
  245. "films",
  246. "species",
  247. "vehicles",
  248. "starships",
  249. "url"
  250. ],
  251. "properties": {
  252. "url": {
  253. "description": "The hypermedia URL of this resource.",
  254. "type": "string"
  255. },
  256. "designation": {
  257. "description": "The designation of this species.",
  258. "type": "string"
  259. },
  260. "films": {
  261. "description": " An array of Film URL Resources that this species has appeared in.",
  262. "type": "array"
  263. },
  264. "average_lifespan": {
  265. "description": "The average lifespan of this species in years.",
  266. "type": "string"
  267. },
  268. "edited": {
  269. "description": "the ISO 8601 date format of the time that this resource was edited.",
  270. "type": "string"
  271. },
  272. "hair_colors": {
  273. "description": "A comma-seperated string of common hair colors for this species, none if this species does not typically have hair.",
  274. "type": "string"
  275. },
  276. "created": {
  277. "description": " the ISO 8601 date format of the time that this resource was created.",
  278. "type": "string"
  279. },
  280. "people": {
  281. "description": "An array of People URL Resources that are a part of this species.",
  282. "type": "array"
  283. },
  284. "classification": {
  285. "description": "The classification of this species.",
  286. "type": "string"
  287. },
  288. "eye_colors": {
  289. "description": "A comma-seperated string of common eye colors for this species, none if this species does not typically have eyes.",
  290. "type": "string"
  291. },
  292. "language": {
  293. "description": "The language commonly spoken by this species.",
  294. "type": "string"
  295. },
  296. "skin_colors": {
  297. "description": "A comma-seperated string of common skin colors for this species, none if this species does not typically have skin.",
  298. "type": "string"
  299. },
  300. "homeworld": {
  301. "description": "The URL of a planet resource, a planet that this species originates from.",
  302. "type": "string"
  303. },
  304. "name": {
  305. "description": "The name of this species.",
  306. "type": "string"
  307. },
  308. "average_height": {
  309. "description": "The average height of this person in centimeters.",
  310. "type": "string"
  311. }
  312. },
  313. "title": "Species",
  314. "$schema": "http://json-schema.org/draft-04/schema"
  315. },
  316. vehicles: {
  317. "description": "A vehicle.",
  318. "type": "object",
  319. "required": [
  320. "name",
  321. "model",
  322. "manufacturer",
  323. "cost_in_credits",
  324. "length",
  325. "max_atmosphering_speed",
  326. "crew",
  327. "passengers",
  328. "cargo_capacity",
  329. "consumables",
  330. "vehicle_class",
  331. "pilots",
  332. "films",
  333. "created",
  334. "edited",
  335. "url"
  336. ],
  337. "properties": {
  338. "max_atmosphering_speed": {
  339. "description": "The maximum speed of this vehicle in atmosphere.",
  340. "type": "string"
  341. },
  342. "films": {
  343. "description": "An array of Film URL Resources that this vehicle has appeared in.",
  344. "type": "array"
  345. },
  346. "passengers": {
  347. "description": "The number of non-essential people this vehicle can transport.",
  348. "type": "string"
  349. },
  350. "url": {
  351. "description": "The hypermedia URL of this resource.",
  352. "type": "string"
  353. },
  354. "length": {
  355. "description": "The length of this vehicle in meters.",
  356. "type": "string"
  357. },
  358. "edited": {
  359. "description": "the ISO 8601 date format of the time that this resource was edited.",
  360. "type": "string"
  361. },
  362. "cargo_capacity": {
  363. "description": "The maximum number of kilograms that this vehicle can transport.",
  364. "type": "string"
  365. },
  366. "created": {
  367. "description": "The ISO 8601 date format of the time that this resource was created.",
  368. "type": "string"
  369. },
  370. "consumables": {
  371. "description": "The maximum length of time that this vehicle can provide consumables for its entire crew without having to resupply.",
  372. "type": "string"
  373. },
  374. "cost_in_credits": {
  375. "description": "The cost of this vehicle new, in galactic credits.",
  376. "type": "string"
  377. },
  378. "crew": {
  379. "description": "The number of personnel needed to run or pilot this vehicle.",
  380. "type": "string"
  381. },
  382. "pilots": {
  383. "description": "An array of People URL Resources that this vehicle has been piloted by.",
  384. "type": "array"
  385. },
  386. "name": {
  387. "description": "The name of this vehicle. The common name, such as Sand Crawler.",
  388. "type": "string"
  389. },
  390. "model": {
  391. "description": "The model or official name of this vehicle. Such as All Terrain Attack Transport.",
  392. "type": "string"
  393. },
  394. "manufacturer": {
  395. "description": "The manufacturer of this vehicle. Comma seperated if more than one.",
  396. "type": "string"
  397. },
  398. "vehicle_class": {
  399. "description": "The class of this vehicle, such as Wheeled.",
  400. "type": "string"
  401. }
  402. },
  403. "title": "Vehicle",
  404. "$schema": "http://json-schema.org/draft-04/schema"
  405. },
  406. starships: {
  407. "description": "A Starship",
  408. "type": "object",
  409. "required": [
  410. "name",
  411. "model",
  412. "manufacturer",
  413. "cost_in_credits",
  414. "length",
  415. "max_atmosphering_speed",
  416. "crew",
  417. "passengers",
  418. "cargo_capacity",
  419. "consumables",
  420. "hyperdrive_rating",
  421. "MGLT",
  422. "starship_class",
  423. "pilots",
  424. "films",
  425. "created",
  426. "edited",
  427. "url"
  428. ],
  429. "properties": {
  430. "max_atmosphering_speed": {
  431. "description": "The maximum speed of this starship in atmosphere. n/a if this starship is incapable of atmosphering flight.",
  432. "type": "string"
  433. },
  434. "starship_class": {
  435. "description": "The class of this starship, such as Starfighter or Deep Space Mobile Battlestation.",
  436. "type": "string"
  437. },
  438. "films": {
  439. "description": "An array of Film URL Resources that this starship has appeared in.",
  440. "type": "array"
  441. },
  442. "passengers": {
  443. "description": "The number of non-essential people this starship can transport.",
  444. "type": "string"
  445. },
  446. "MGLT": {
  447. "description": "The Maximum number of Megalights this starship can travel in a standard hour. A Megalight is a standard unit of distance and has never been defined before within the Star Wars universe. This figure is only really useful for measuring the difference in speed of starships. We can assume it is similar to AU, the distance between our Sun (Sol) and Earth.",
  448. "type": "string"
  449. },
  450. "length": {
  451. "description": "The length of this starship in meters.",
  452. "type": "string"
  453. },
  454. "hyperdrive_rating": {
  455. "description": "The class of this starships hyperdrive.",
  456. "type": "string"
  457. },
  458. "edited": {
  459. "description": "the ISO 8601 date format of the time that this resource was edited.",
  460. "type": "string"
  461. },
  462. "created": {
  463. "description": "The ISO 8601 date format of the time that this resource was created.",
  464. "type": "string"
  465. },
  466. "consumables": {
  467. "description": "The maximum length of time that this starship can provide consumables for its entire crew without having to resupply.",
  468. "type": "string"
  469. },
  470. "cost_in_credits": {
  471. "description": "The cost of this starship new, in galactic credits.",
  472. "type": "string"
  473. },
  474. "crew": {
  475. "description": "The number of personnel needed to run or pilot this starship.",
  476. "type": "string"
  477. },
  478. "pilots": {
  479. "description": "An array of People URL Resources that this starship has been piloted by.",
  480. "type": "array"
  481. },
  482. "name": {
  483. "description": "The name of this starship. The common name, such as Death Star.",
  484. "type": "string"
  485. },
  486. "model": {
  487. "description": "The model or official name of this starship. Such as T-65 X-wing or DS-1 Orbital Battle Station.",
  488. "type": "string"
  489. },
  490. "manufacturer": {
  491. "description": "The manufacturer of this starship. Comma seperated if more than one.",
  492. "type": "string"
  493. },
  494. "cargo_capacity": {
  495. "description": "The maximum number of kilograms that this starship can transport.",
  496. "type": "string"
  497. },
  498. "url": {
  499. "description": "The hypermedia URL of this resource.",
  500. "type": "string"
  501. }
  502. },
  503. "title": "Starship",
  504. "$schema": "http://json-schema.org/draft-04/schema"
  505. }
  506. }