Skip to content

Instantly share code, notes, and snippets.

@akshayvkt
Last active November 9, 2023 20:14
Show Gist options
  • Save akshayvkt/a8c60dd2be891636820eae1ab46fb654 to your computer and use it in GitHub Desktop.
Save akshayvkt/a8c60dd2be891636820eae1ab46fb654 to your computer and use it in GitHub Desktop.
Creating a simple json with auth to test GPT
{
"openapi": "3.0.0",
"info": {
"title": "Geocoding API",
"version": "1.0.0",
"description": "API for converting addresses into geographic coordinates (latitude and longitude)."
},
"servers": [
{
"url": "https://maps.googleapis.com/maps/api"
}
],
"paths": {
"/geocode/json": {
"get": {
"summary": "Get Latitude and Longitude for an Address",
"operationId": "getLatLon",
"tags": [
"Geocoding"
],
"parameters": [
{
"name": "address",
"in": "query",
"required": true,
"description": "The address to get coordinates for.",
"schema": {
"type": "string"
}
},
{
"name": "key",
"in": "query",
"required": true,
"description": "Your API key.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A successful response that contains the latitude and longitude.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"lat": {
"type": "number",
"format": "float"
},
"lon": {
"type": "number",
"format": "float"
}
}
}
}
}
},
"400": {
"description": "Error: Bad Request. The address provided is invalid."
},
"500": {
"description": "HTTP Error: Internal Server Error. Something went wrong on the server side."
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment