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

Add APIv2 OpenAPI specification #1852

Open
wants to merge 3 commits into
base: apiv2
Choose a base branch
from
Open

Conversation

manuelwedler
Copy link
Collaborator

@manuelwedler manuelwedler commented Jan 9, 2025

apiv2.yaml is directly retrieved from Stoplight and can just be copy-pasted again when an update is needed in the future. Only if we add more endpoints we need to manually reference them in openapi.yaml due to limitations of the OpenAPI spec.

Needed to change the mode of the validator's refparser because the we reference the same file multiple times now.

I'm not sure about the tags for the swagger documentation yet. Maybe we should add a "deprecated" to APIv1 instead of the "API v1" prefix?

`apiv2.yaml` is directly retrieved from Stoplight and can just be copy-pasted again when an update is needed in the future

Needed to change the mode of the validator's refparser because the we reference the same file multiple times now
@manuelwedler
Copy link
Collaborator Author

I'm not sure about the tags for the swagger documentation yet. Maybe we should add a "deprecated" to APIv1 instead of the "API v1" prefix?

I think I will also mark API v1 endpoints as deprecated and change the tags

@manuelwedler
Copy link
Collaborator Author

Ready for review again

Copy link
Member

@kuzdogan kuzdogan left a comment

Choose a reason for hiding this comment

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

I think we should move (Deprecated) part to the beginning of titles. I went forward and done those myself, I'm guessing that's ok.

Otherwise I can't run it as is. I tried clearing the build cache etc. but I get the following output, (quite long so truncated)

  },
  {
    "instancePath": "/paths/~1v2~1contracts~1{chainId}/get/responses/500/content/application~1json/schema",
    "schemaPath": "#/properties/schema/oneOf",
    "keyword": "oneOf",
    "params": {
      "passingSchemas": null
    },
    "message": "must match exactly one schema in oneOf"
  },
  {
    "instancePath": "/paths/~1v2~1contracts~1{chainId}/get/responses/500",
    "schemaPath": "#/definitions/Reference/required",
    "keyword": "required",
    "params": {
      "missingProperty": "$ref"
    },
    "message": "must have required property '$ref'"
  },
  {
    "instancePath": "/paths/~1v2~1contracts~1{chainId}/get/responses/500",
    "schemaPath": "#/patternProperties/%5E%5B1-5%5D(%3F%3A%5Cd%7B2%7D%7CXX)%24/oneOf",
    "keyword": "oneOf",
    "params": {
      "passingSchemas": null
    },
    "message": "must match exactly one schema in oneOf"
  }
]

Also when I run the server and try to access any endpoint I get this:
image

@manuelwedler
Copy link
Collaborator Author

Hm I cannot reproduce this. Just tried again with a clean install and build, and the server responds correctly as expected. Also the CI works. I can try again on Monday.

@kuzdogan
Copy link
Member

kuzdogan commented Jan 10, 2025

Let's also see what @marcocastignoli has, maybe a Linux/MacOs thing.

Can you build the branch and run the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Sprint - Needs Review
Development

Successfully merging this pull request may close these issues.

2 participants