Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Enjoi = require("enjoi");
- const gmapsObject = Enjoi.schema({
- type: "object",
- required: ["results", "status"],
- properties: {
- results: {
- $id: "#/properties/results",
- type: "array",
- title: "The Results Schema",
- items: {
- $id: "#/properties/results/items",
- type: "object",
- title: "The Items Schema",
- required: [
- "address_components",
- "formatted_address",
- "geometry",
- "place_id",
- "types"
- ],
- properties: {
- address_components: {
- $id: "#/properties/results/items/properties/address_components",
- type: "array",
- title: "The Address_components Schema",
- items: {
- $id:
- "#/properties/results/items/properties/address_components/items",
- type: "object",
- title: "The Items Schema",
- required: ["long_name", "short_name", "types"],
- properties: {
- long_name: {
- $id:
- "#/properties/results/items/properties/address_components/items/properties/long_name",
- type: "string",
- title: "The Long_name Schema",
- default: "",
- examples: ["13185-472"],
- pattern: "^(.*)$"
- },
- short_name: {
- $id:
- "#/properties/results/items/properties/address_components/items/properties/short_name",
- type: "string",
- title: "The Short_name Schema",
- default: "",
- examples: ["13185-472"],
- pattern: "^(.*)$"
- },
- types: {
- $id:
- "#/properties/results/items/properties/address_components/items/properties/types",
- type: "array",
- title: "The Types Schema",
- items: {
- $id:
- "#/properties/results/items/properties/address_components/items/properties/types/items",
- type: "string",
- title: "The Items Schema",
- default: "",
- examples: ["postal_code"],
- pattern: "^(.*)$"
- }
- }
- }
- }
- },
- formatted_address: {
- $id: "#/properties/results/items/properties/formatted_address",
- type: "string",
- title: "The Formatted_address Schema",
- default: "",
- examples: [
- "Jardim Nossa Sra. de Fatima, Hortolândia - SP, 13185-472, Brazil"
- ],
- pattern: "^(.*)$"
- },
- geometry: {
- $id: "#/properties/results/items/properties/geometry",
- type: "object",
- title: "The Geometry Schema",
- required: ["bounds", "location", "location_type", "viewport"],
- properties: {
- bounds: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds",
- type: "object",
- title: "The Bounds Schema",
- required: ["northeast", "southwest"],
- properties: {
- northeast: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds/properties/northeast",
- type: "object",
- title: "The Northeast Schema",
- required: ["lat", "lng"],
- properties: {
- lat: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds/properties/northeast/properties/lat",
- type: "number",
- title: "The Lat Schema",
- default: 0.0,
- examples: [-22.8944949]
- },
- lng: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds/properties/northeast/properties/lng",
- type: "number",
- title: "The Lng Schema",
- default: 0.0,
- examples: [-47.1671647]
- }
- }
- },
- southwest: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds/properties/southwest",
- type: "object",
- title: "The Southwest Schema",
- required: ["lat", "lng"],
- properties: {
- lat: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds/properties/southwest/properties/lat",
- type: "number",
- title: "The Lat Schema",
- default: 0.0,
- examples: [-22.9005]
- },
- lng: {
- $id:
- "#/properties/results/items/properties/geometry/properties/bounds/properties/southwest/properties/lng",
- type: "number",
- title: "The Lng Schema",
- default: 0.0,
- examples: [-47.1690001]
- }
- }
- }
- }
- },
- location: {
- $id:
- "#/properties/results/items/properties/geometry/properties/location",
- type: "object",
- title: "The Location Schema",
- required: ["lat", "lng"],
- properties: {
- lat: {
- $id:
- "#/properties/results/items/properties/geometry/properties/location/properties/lat",
- type: "number",
- title: "The Lat Schema",
- default: 0.0,
- examples: [-22.8967016]
- },
- lng: {
- $id:
- "#/properties/results/items/properties/geometry/properties/location/properties/lng",
- type: "number",
- title: "The Lng Schema",
- default: 0.0,
- examples: [-47.1686594]
- }
- }
- },
- location_type: {
- $id:
- "#/properties/results/items/properties/geometry/properties/location_type",
- type: "string",
- title: "The Location_type Schema",
- default: "",
- examples: ["APPROXIMATE"],
- pattern: "^(.*)$"
- },
- viewport: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport",
- type: "object",
- title: "The Viewport Schema",
- required: ["northeast", "southwest"],
- properties: {
- northeast: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport/properties/northeast",
- type: "object",
- title: "The Northeast Schema",
- required: ["lat", "lng"],
- properties: {
- lat: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport/properties/northeast/properties/lat",
- type: "number",
- title: "The Lat Schema",
- default: 0.0,
- examples: [-22.8944949]
- },
- lng: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport/properties/northeast/properties/lng",
- type: "number",
- title: "The Lng Schema",
- default: 0.0,
- examples: [-47.1667334197085]
- }
- }
- },
- southwest: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport/properties/southwest",
- type: "object",
- title: "The Southwest Schema",
- required: ["lat", "lng"],
- properties: {
- lat: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport/properties/southwest/properties/lat",
- type: "number",
- title: "The Lat Schema",
- default: 0.0,
- examples: [-22.9005]
- },
- lng: {
- $id:
- "#/properties/results/items/properties/geometry/properties/viewport/properties/southwest/properties/lng",
- type: "number",
- title: "The Lng Schema",
- default: 0.0,
- examples: [-47.1694313802915]
- }
- }
- }
- }
- }
- }
- },
- place_id: {
- $id: "#/properties/results/items/properties/place_id",
- type: "string",
- title: "The Place_id Schema",
- default: "",
- examples: ["ChIJYxzhq0-4yJQRWtRa9ywEYyk"],
- pattern: "^(.*)$"
- },
- types: {
- $id: "#/properties/results/items/properties/types",
- type: "array",
- title: "The Types Schema",
- items: {
- $id: "#/properties/results/items/properties/types/items",
- type: "string",
- title: "The Items Schema",
- default: "",
- examples: ["postal_code"],
- pattern: "^(.*)$"
- }
- }
- }
- }
- },
- status: {
- $id: "#/properties/status",
- type: "string",
- title: "The Status Schema",
- default: "",
- examples: ["OK"],
- pattern: "^(.*)$"
- }
- }
- });
- module.exports = {
- googleMaps: gmapsObject
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement