# swagger.yml openapi: 3.0.0 info: title: "2001 Trail API" description: "An API about trails and notes" version: "1.0.0" servers: - url: "/api" components: schemas: Trail: type: "object" required: - TrailID properties: TrailID: type: "integer" Trail_name: type: "string" Trail_Summary: type: "string" Trail_Description: type: "string" Difficulty: type: "string" Location: type: "string" Length: type: "number" Elevation_gain: type: "number" Route_type: type: "string" OwnerID: type: "integer" TUser: required: - UserID properties: UserID: type: "integer" Email_address: type: "string" Role: type: "string" User_Name: type: "string" PassWord: type: "string" Feature: type: "object" required: - Feature_ID properties: Feature_ID: type: "integer" Name: type: "string" Trail_Feature: type: "object" required: - Feature_ID - TrailID properties: Feature_ID: type: "integer" TrailID: type: "integer" traillocationpoint: type: "object" required: - TrailID - Location_Point properties: TrailID: type: "integer" Location_Point: type: "integer" Order_no: type: "integer" Location_Pt: type: "object" required: - Location_Point properties: Location_Point: type: "integer" Latitude: type: "number" Longitude: type: "number" Description: type: "string" parameters: FeatureID: name: "FeatureID" description: "ID of trail to get" in: path required: True schema: type: "integer" TrailID: name: "TrailID" description: "ID of trail to get" in: path required: True schema: type: "integer" UserID: name: "UserID" description: "ID of the user" in: path required: True schema: type: "integer" LocationPoint: name: "LocationPoint" description: "Point on a trail" in: path required: true schema: type: "integer" UserName: name: "UserName" description: "UserName" in: path required: True schema: type: "string" PassWord: name: "PassWord" description: "PassWord" in: path required: True schema: type: "string" Email: name: "Email" description: "Email" in: path required: True schema: type: "string" paths: /trails: get: operationId: "trails.read_all" tags: - Trails summary: "Read the list of trails" responses: "200": description: "Successfully read trails list" /trails/{TrailID}/{Email}/{PassWord}: put: tags: - Trails operationId: "trails.update" summary: "update a trail" parameters: - $ref: "#/components/parameters/TrailID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "200": description: "Successfully updated trail" requestBody: content: application/json: schema: x-body-name: "trail" $ref: "#/components/schemas/Trail" delete: tags: - Trails operationId: "trails.delete" summary: "Delete a trail" parameters: - $ref: "#/components/parameters/TrailID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204": description: "Successfully deleted trail" /trails/{TrailID}: get: operationId: "trails.read_one" tags: - Trails summary: "Read one trail" parameters: - $ref: "#/components/parameters/TrailID" responses: "200": description: "Successfully read Trail" /trails/{Email}/{PassWord}: post: operationId: "trails.create" tags: - Trails summary: "Create a trail" parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "Trail to create" required: True content: application/json: schema: x-body-name: "trail" $ref: "#/components/schemas/Trail" responses: "201": description: "Successfully created trail" /TUser/{Email}/{PassWord}: get: operationId: "users.read_all" tags: - Users summary: "Read the list of users" parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "200": description: "Successfully read users list" post: operationId: "users.create" tags: - Users summary: "Create a user " parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "User to create" required: True content: application/json: schema: x-body-name: "user" $ref: "#/components/schemas/TUser" responses: "201": description: "Successfully created user" /TUser/{UserID}/{Email}/{PassWord}: put: tags: - Users operationId: "users.update" summary: "update a user" parameters: - $ref: "#/components/parameters/UserID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "200": description: "Successfully updated user" requestBody: content: application/json: schema: x-body-name: "tuser" $ref: "#/components/schemas/TUser" get: operationId: "users.read_one" tags: - Users summary: "Read one user" parameters: - $ref: "#/components/parameters/UserID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "200": description: "Successfully read one User" delete: tags: - Users operationId: "users.delete" summary: "Delete a user" parameters: - $ref: "#/components/parameters/UserID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204" : description: "Successfully deleted note" /features/{FeatureID}: get: operationId: "features.read_one" tags: - Features summary: "read one feature" parameters: - $ref: "#/components/parameters/FeatureID" responses: 200: description: "Successfully read one Feature" /features/{FeatureID}/{Email}/{PassWord}: put: tags: - Features operationId: "features.update" summary: "update a feature" parameters: - $ref: "#/components/parameters/FeatureID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "200": description: "Successfully updated Feature" requestBody: description: "feature to create" required: True content: application/json: schema: x-body-name: "feature" $ref: "#/components/schemas/Feature" delete: tags: - Features operationId: "features.delete" summary: "Delete a Feature" parameters: - $ref: "#/components/parameters/FeatureID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204" : description: "Successfully deleted Feature" /features: get: operationId: "features.read_all" tags: - "Features" summary: "Read the list of features" responses: "200": description: "Successfully read features list" /features/{Email}/{PassWord}: post: operationId: "features.create" tags: - Features summary: "Create a feature" parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "feature to create" required: True content: application/json: schema: x-body-name: "feature" $ref: "#/components/schemas/Feature" responses: "201": description: "Successfully created feature" /trail_features: get: operationId: "trail_features.read_all" tags: - Trail_Features summary: "Read the list of trail features" responses: "200": description: "Successfully read trail features list" /trail_features/{FeatureID}/{TrailID}/{Email}/{PassWord}: put: tags: - Trail_Features operationId: "trail_features.update" summary: "Delete a Feature of a trail" parameters: - $ref: "#/components/parameters/FeatureID" - $ref: "#/components/parameters/TrailID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204" : description: "Successfully updated Feature of trail" delete: tags: - Trail_Features operationId: "trail_features.delete" summary: "Delete a Feature of a trail" parameters: - $ref: "#/components/parameters/FeatureID" - $ref: "#/components/parameters/TrailID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204" : description: "Successfully deleted Feature of trail" /trail_features/{Email}/{PassWord}: post: operationId: "trail_features.create" tags: - Trail_Features summary: "Create a trail feature" parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "Trail feature to create" required: True content: application/json: schema: x-body-name: "trailfeature" $ref: "#/components/schemas/Trail_Feature" responses: "201": description: "Successfully created trail feature" /trail_features/{TrailID}: get: operationId: "trail_features.read_one_trails_features" tags: - Trail_Features summary: "read one feature" parameters: - $ref: "#/components/parameters/TrailID" responses: 200: description: "Successfully read one trails features" /trail_locationpt: get: operationId: "trail_locationpt.read_all" tags: - Trail_locationpt summary: "Read the list of trail points" responses: "200": description: "Successfully read trail points list " /trail_locationpt/{TrailID}: get: operationId: "trail_locationpt.read_one_trails_points" tags: - Trail_locationpt summary: "read one feature" parameters: - $ref: "#/components/parameters/TrailID" responses: 200: description: "Successfully read one trails location points" /trail_locationpt/{Email}/{PassWord}: post: operationId: "trail_locationpt.create" tags: - Trail_locationpt summary: "Create a trail point" parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "point to create" required: True content: application/json: schema: x-body-name: "traillocationpoint" $ref: "#/components/schemas/traillocationpoint" responses: "201": description: "Successfully created point for trail" /trail_locationpt/{LocationPoint}/{TrailID}/{Email}/{PassWord}: put: tags: - Trail_locationpt operationId: "trail_locationpt.update" summary: "Update a location point for a trail" parameters: - $ref: "#/components/parameters/LocationPoint" - $ref: "#/components/parameters/TrailID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "point to update" required: True content: application/json: schema: x-body-name: "traillocationpoint" $ref: "#/components/schemas/traillocationpoint" responses: "204" : description: "Successfully updated point of trail" delete: tags: - Trail_locationpt operationId: "trail_locationpt.delete" summary: "Delete a point of a trail" parameters: - $ref: "#/components/parameters/LocationPoint" - $ref: "#/components/parameters/TrailID" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204" : description: "Successfully deleted point of trail" /LocationPt: get: operationId: "location_pt.read_all" tags: - Location_Point summary: "Read the list of location points" responses: "200": description: "Successfully read location points list " /LocationPt/{Email}/{PassWord}: post: operationId: "location_pt.create" tags: - Location_Point summary: "Create a location point" parameters: - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" requestBody: description: "point to create" required: True content: application/json: schema: x-body-name: "locationpt" $ref: "#/components/schemas/Location_Pt" responses: "201": description: "Successfully created point" /LocationPt/{LocationPoint}/{Email}/{PassWord}: put: tags: - Location_Point operationId: "location_pt.update" summary: "update a location point" parameters: - $ref: "#/components/parameters/LocationPoint" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "200": description: "Successfully updated Location point" requestBody: content: application/json: schema: x-body-name: "point" $ref: "#/components/schemas/Location_Pt" delete: tags: - Location_Point operationId: "location_pt.delete" summary: "Delete a point" parameters: - $ref: "#/components/parameters/LocationPoint" - $ref: "#/components/parameters/Email" - $ref: "#/components/parameters/PassWord" responses: "204": description: "Successfully deleted point" /LocationPt/{LocationPoint}: get: operationId: "location_pt.read_one" tags: - Location_Point summary: "Read one point" parameters: - $ref: "#/components/parameters/LocationPoint" responses: "200": description: "Successfully read point"