MMGIS icon indicating copy to clipboard operation
MMGIS copied to clipboard

[New Feature]: Add API Client and/or OpenAPI Specification

Open ryanghunter opened this issue 8 months ago • 3 comments

Checked for duplicates

Yes - I've already checked

Alternatives considered

No - I haven't considered

Related problems

I want to automate my team's interactions with MMGIS via the provided API. The API is well documented in markdown, but building out the client code is too time intensive for us right now. If MMGIS supported or provided an Open API spec (or a Python client), I think it would be easier for users to integrate API usage into their tools and automate interactions with MMGIS.

Describe the feature request

I propose adding one (or both) of the following solutions:

Option 1: OpenAPI Specification

Create a formal OpenAPI 3.0 specification that:

  • Documents all existing API endpoints, parameters, and responses
  • Serves as a single source of truth for API definitions
  • Can be used to auto-generate documentation with Swagger UI
  • Can be used to generate client libraries in multiple languages

Option 2: Python Client Library

Develop an official Python client library that:

  • Wraps all MMGIS API endpoints in an intuitive interface
  • Handles authentication, request formatting, and response parsing
  • Is easily importable via pip (pip install mmgis-client)
  • Uses type hints for better developer experience
  • Is generated from (or alongside) a formal API specification

Starting with an OpenAPI definition would make it easier to generate clients in other languages as well. There's a host of tools that exist for generating clients in different languages from an OpenAPI spec: https://openapi-generator.tech/

ryanghunter avatar Jun 17 '25 16:06 ryanghunter

I'd be happy to contribute if the project thinks this would be useful. I would need to build a client out (at some point) for my project anyway.

ryanghunter avatar Jun 17 '25 22:06 ryanghunter

Hi Ryan and we do already have an OpenAPI spec for MMGIS! https://github.com/NASA-AMMOS/MMGIS/blob/development/docs/mmgis-openapi.json Alternatively, if you have MMGIS running, you can view its swagger docs at: /api/docs

Another member of the MMGIS team has been working on a python client library and I'll get you in touch with them.

tariqksoliman avatar Jun 20 '25 16:06 tariqksoliman

Hi Ryan. I've been manually generating an MMGIS Python module to allow API access to missions, starting with some initial authentication and Layer add/update/remove functionality. We can see if the open-api generator site above could speed up that process.

fcalef avatar Jun 20 '25 16:06 fcalef