Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split openAPI files by tag #971

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

dexamundsen
Copy link
Contributor

@dexamundsen dexamundsen commented Aug 28, 2024

Split all the single open api file into multiple smaller files, by the path tags. No changes to any path, parameter or schema

@dexamundsen dexamundsen marked this pull request as draft August 29, 2024 00:32
500:
$ref: "#/components/responses/ServerError"
/v2/profile:
$ref: './users.yaml#/paths/~1getMe'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't say I love these weird refs or having to list all the APIs here. This is the only way to split it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openapi spec demands this approach for splitting it. https://swagger.io/docs/specification/using-ref/

@@ -2,2941 +2,166 @@ openapi: 3.0.3
info:
title: Tanagra Service API
description: github.com/DataBiosphere/tanagra
version: 0.0.0
version: 0.0.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If none of the APIs changed, why bump the version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can revert this, thought was that we actually have a deployed version, so '0' might be stale

type: number
format: double

# --------------- Criteria ---------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Criteria are a piece of a cohort or data feature set, not part of the query api or entity model.

# Underlay-Entity APIs, parameters & schema objects

paths:
/listEntities:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the entity endpoints fit better with the underlay endpoints. Most of the rest of this file are the query endpoints. So perhaps also renaming this to query.yaml would be helpful.


paths:
# --------------- Unauthenticated Paths ---------------

"/status":
/status:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps moving the unauthenticated endpoints to their own file (e.g. unauthenticated.yaml) would be clearer, so we always follow the same pattern when adding new endpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I can move them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

- $ref: '#/components/parameters/ActivityLogFilterExactMatch'
- $ref: '#/components/parameters/ActivityLogFilterResourceType'
- $ref: '#/components/parameters/ActivityLogFilterActivityType'
- $ref: './common.yaml#/components/parameters/Offset'
Copy link
Collaborator

@marikomedlock marikomedlock Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we don't have to worry about where a shared object is in order to reference it. Could using the same approach that it looks like WSM is using obviate the need for this?

@dexamundsen
Copy link
Contributor Author

using this approach also needs a change in gradle plugin (from hidelake to openapitools), holding it till I get to those changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants