Small changes to Swagger API doc

This commit is contained in:
Timo John 2020-07-10 11:17:54 +02:00
parent 531f133875
commit 8231127099

View File

@ -22,14 +22,14 @@ module.exports = dbConn => {
/** /**
* @swagger * @swagger
* /update/climate/v1: * /update/climate/v1:
* patch: * put:
* summary: Pull monthly data from meteostat API V2 * summary: Pull monthly data from meteostat API V1
* tags: [Update] * tags: [Update]
* responses: * responses:
* "200": * "200":
* description: Update information is logged in backend * description: Update information is logged in backend
*/ */
router.patch("/api/v1/update/climate/v1", async (req, res) => { router.put("/api/v1/update/climate/v1", async (req, res) => {
const update = await handleClimateUpdate(dbConn) const update = await handleClimateUpdate(dbConn)
res.json(update) res.json(update)
}); });
@ -37,14 +37,14 @@ module.exports = dbConn => {
/** /**
* @swagger * @swagger
* /update/climate/v2: * /update/climate/v2:
* patch: * put:
* summary: Pull daily data from meteostat API V2 * summary: Pull daily data from meteostat API V2. Data is written to Travopti database and must be processed manually before it can be used.
* tags: [Update] * tags: [Update]
* responses: * responses:
* "200": * "200":
* description: Update information is logged in backend * description: Update information is logged in backend
*/ */
router.patch("/api/v1/update/climate/v2", async (req, res) => { router.put("/api/v1/update/climate/v2", async (req, res) => {
const update = await handleClimateUpdateV2(dbConn) const update = await handleClimateUpdateV2(dbConn)
res.json(update) res.json(update)
}); });
@ -52,49 +52,49 @@ module.exports = dbConn => {
/** /**
* @swagger * @swagger
* /update/regions/all/nearby: * /update/regions/all/nearby:
* patch: * put:
* summary: Updates all nearby data for all regions * summary: Updates all nearby data for all regions
* tags: [Update] * tags: [Update]
* responses: * responses:
* "200": * "200":
* description: Updates all nearby data for all regions * description: Updates all nearby data for all regions
*/ */
router.patch("/api/v1/update/regions/all/nearby", async (req, res) => { router.put("/api/v1/update/regions/all/nearby", async (req, res) => {
res.json(await handleUpdateRegionNearby(dbConn)) res.json(await handleUpdateRegionNearby(dbConn))
}); });
/** /**
* @swagger * @swagger
* /update/regions/all/lonlat: * /update/regions/all/lonlat:
* patch: * put:
* summary: Updates all coordinate data for all regions * summary: Updates all coordinate data for all regions
* tags: [Update] * tags: [Update]
* responses: * responses:
* "200": * "200":
* description: Updates all coordinate data for all regions * description: Updates all coordinate data for all regions
*/ */
router.patch("/api/v1/update/regions/all/lonlat", async (req,res) => { router.put("/api/v1/update/regions/all/lonlat", async (req,res) => {
res.json(await handleRegionLonLat(dbConn)) res.json(await handleRegionLonLat(dbConn))
}); });
/** /**
* @swagger * @swagger
* /update/regions/all/nearby/image: * /update/regions/all/nearby/image:
* patch: * put:
* summary: Updates the nearby image urls for all regions * summary: Updates the nearby image urls for all regions
* tags: [Update] * tags: [Update]
* responses: * responses:
* "200": * "200":
* description: Updates the nearby image urls for all regions * description: Updates the nearby image urls for all regions
*/ */
router.patch("/api/v1/update/regions/all/nearby/image", async (req, res) => { router.put("/api/v1/update/regions/all/nearby/image", async (req, res) => {
res.json(await handleUpdateRegionNearbyImgUrl(dbConn)) res.json(await handleUpdateRegionNearbyImgUrl(dbConn))
}); });
/** /**
* @swagger * @swagger
* /update/regions/{id}/nearby: * /update/regions/{id}/nearby:
* patch: * put:
* summary: Updates the nearby data for a specific region * summary: Updates the nearby data for a specific region
* tags: [Update] * tags: [Update]
* parameters: * parameters:
@ -106,7 +106,7 @@ module.exports = dbConn => {
* "200": * "200":
* description: Updates the nearby data for a specific region * description: Updates the nearby data for a specific region
*/ */
router.patch("/api/v1/update/regions/:id/nearby", async (req, res) => { router.put("/api/v1/update/regions/:id/nearby", async (req, res) => {
const id = sqlSanitzer(req.params.id); const id = sqlSanitzer(req.params.id);
res.json(await handleUpdateRegionNearbyById(dbConn, id)) res.json(await handleUpdateRegionNearbyById(dbConn, id))
}); });
@ -114,7 +114,7 @@ module.exports = dbConn => {
/** /**
* @swagger * @swagger
* /update/regions/{id}/nearby/image: * /update/regions/{id}/nearby/image:
* patch: * put:
* summary: Updates the nearby image urls for a specific region * summary: Updates the nearby image urls for a specific region
* tags: [Update] * tags: [Update]
* parameters: * parameters:
@ -126,7 +126,7 @@ module.exports = dbConn => {
* "200": * "200":
* description: Updates the nearby image urls for a specific region * description: Updates the nearby image urls for a specific region
*/ */
router.patch("/api/v1/update/regions/:id/nearby/image", async (req, res) => { router.put("/api/v1/update/regions/:id/nearby/image", async (req, res) => {
const id = sqlSanitzer(req.params.id); const id = sqlSanitzer(req.params.id);
res.json(await handleUpdateRegionNearbyImgUrlById(dbConn, id)) res.json(await handleUpdateRegionNearbyImgUrlById(dbConn, id))
}); });