Skip to content

Commit

Permalink
#3 : Updates the current work on openapi v3 for eonet. Cleans up ret…
Browse files Browse the repository at this point in the history
…rieve_category used primarily for testing.
  • Loading branch information
sunayana committed Aug 28, 2021
1 parent 692eb07 commit c5fb3dc
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 27 deletions.
4 changes: 2 additions & 2 deletions apps/retrieve_category.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import swagger_client
from swagger_client.api.default_api import DefaultApi
from swagger_client.rest import ApiException
from swagger_client.models import CategoryResponse


def main():
api = DefaultApi()
wildfire_response = api.categories_category_id_get("wildfires")
wildfire_response: CategoryResponse = api.categories_category_id_get("wildfires")

print(wildfire_response)

Expand Down
98 changes: 73 additions & 25 deletions openapi/eonet-v3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,89 @@ info:
servers:
- url: https://eonet.sci.gsfc.nasa.gov/api/v3
- url: http://eonet.sci.gsfc.nasa.gov/api/v3

paths:
/categories/{categoryId}:
/categories/{categoryId}: # ../categories
get:
tags:
- categories
summary: Categories are the types of events by which individual events are cataloged
description: Returns a single category
operationId: getCategoryById
summary: Returns a json object of categories.
description: ""
parameters:
- name: categoryId
in: path
description: ID of category to return
required: true
schema:
type: integer
format: int64
minimum: 1
- name: categoryId
in: path
required: true
description: Filter the events by the Category.
schema:
type: string
- name: source
in: query
required: false
description: Filter the topically-constrained events by the Source. Multiple sources can be included in the parameter, comma separated, operates as a boolean OR.
schema:
type : string
- name: status
in: query
required: false
description: Events that have ended are assigned a closed date and the existence of that date will allow you to filter for only-open or only-closed events. Omitting the status parameter will return only the currently open events.
schema:
type: string
default: open
enum:
- open
- closed
- name: limit
in: query
required: false
description: Limits the number of events returned.
schema:
type: integer
format: int64
- name: days
in: query
required: false
description: Limit the number of prior days (including today) from which events will be returned.
schema:
type: integer
format: int64
- name: start
in: query
required: false
description: Select a starting date for the events. To be used together with end parameter.
schema:
type: string
- name: end
in: query
required: false
description: Select an ending date for the events. To be used together with start parameter for defining a range.
schema:
type: string

responses:
200:
description: successful operation
200: #status code
description: A JSON object upon successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Category'
400:
description: Invalid ID supplied
content: {}
404:
description: Category not found
content: {}
$ref: '#/components/schemas/CategoryResponse'
components:
schemas:
Category:
type: object
properties:
id:
type: integer
format: int64
type: string
title:
type: string
description:
type: string
link:
type: string
CategoryResponse:
type: object
properties:
title:
type: string
description:
type: string
link:
type: string

0 comments on commit c5fb3dc

Please sign in to comment.