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

[API] OpenAPI Spec Fixes #988

Open
5 tasks
Olshansk opened this issue Dec 6, 2024 · 1 comment
Open
5 tasks

[API] OpenAPI Spec Fixes #988

Olshansk opened this issue Dec 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Olshansk
Copy link
Member

Olshansk commented Dec 6, 2024

Objective

Fix the generated OpenAPI spec.

Origin Document

Background

pocket-core (Morse) has a really nice OpenAPI spec that I like to link to: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml

It would be helpful to have an easily accessible swagger populated by the spec in Shannon as well.

Bug

If make ignite_openapi_gen is run on main, the resulting openapi.yml file is:

{
  "id": "github.com/pokt-network/poktroll",
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "swagger": "2.0",
  "info":
    {
      "description": "Chain github.com/pokt-network/poktroll REST API",
      "title": "HTTP API Console",
      "contact": { "name": "github.com/pokt-network/poktroll" },
      "version": "version not set",
    },
  "paths": {},
  "definitions":
    {
      "google.protobuf.Any":
        {
          "type": "object",
          "properties": { "@type": { "type": "string" } },
          "additionalProperties": {},
        },
      "google.rpc.Status":
        {
          "type": "object",
          "properties":
            {
              "code": { "type": "integer", "format": "int32" },
              "details":
                {
                  "type": "array",
                  "items":
                    {
                      "type": "object",
                      "$ref": "#/definitions/google.protobuf.Any",
                    },
                },
              "message": { "type": "string" },
            },
        },
    },
}

In order to fix it, we need:

  1. git reset --hard acd7fc8a60f44a05a117050c441609361dd608d3
  2. Comment out staking_fee in proto/poktroll/supplier/params.proto
  3. Rerun make ignite_openapi_gen

Goals

  • Make the OpenAPI spec of Shannon easily accessible
  • Make the OpenAPI spec of Shannon easily accessible
  • Fixing existing bugs on main related to generated the spec

Deliverables

  • Figure out why a bug was introduced (see the background section)
  • After fixing ☝️, Replace all instances of openapi.yml in the code with openapi.json (it was incorrect)
  • Add a link to swagger pointing to the raw (correct) openapi spec in README and docusaurus/README
  • Optionally, find a way to autoformat the generated spec in version control
  • Optionally, find a way to have an easily accessibly .yml file in version control

Creator: @Olshansk
Co-Owners: @bryanchriswhite

@Olshansk Olshansk added the bug Something isn't working label Dec 6, 2024
@Olshansk Olshansk added this to the Shannon Beta TestNet Support milestone Dec 6, 2024
@Olshansk Olshansk added this to Shannon Dec 6, 2024
@Olshansk Olshansk moved this to 🔖 Ready in Shannon Dec 6, 2024
@Olshansk Olshansk assigned Olshansk and unassigned bryanchriswhite Jan 21, 2025
@Olshansk
Copy link
Member Author

Olshansk commented Feb 4, 2025

Was also speaking with @commoddity about:

  1. Updating [1] to have an API section
  2. Directly link to a swagger doc that makes the OpenAPI spec accessible

@Olshansk Olshansk assigned commoddity and unassigned Olshansk Feb 5, 2025
commoddity added a commit that referenced this issue Feb 5, 2025
…sing `ignite` (#1055)

## Summary

Adds a Dockerfile to build the outputted OpenAPI spec in a way that will
work on all dev environments.


## Issue

-
https://discord.com/channels/824324475256438814/997192534168182905/1336447458128957523
- #1054 
- #988
- ignite/cli#4495

## Type of change

Select one or more from the following:

- [x] New feature, functionality or library
- [ ] Consensus breaking; add the `consensus-breaking` label if so. See
#791 for details
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Sanity Checklist

- [ ] I have updated the GitHub Issue `assignees`, `reviewers`,
`labels`, `project`, `iteration` and `milestone`
- [ ] For docs, I have run `make docusaurus_start`
- [ ] For code, I have run `make go_develop_and_test` and `make
test_e2e`
- [ ] For code, I have added the `devnet-test-e2e` label to run E2E
tests in CI
- [ ] For configurations, I have update the documentation
- [ ] I added TODOs where applicable

---------

Co-authored-by: Daniel Olshansky <[email protected]>
@Olshansk Olshansk moved this from 🔖 Ready to ✅ Done in Shannon Feb 11, 2025
@Olshansk Olshansk moved this from ✅ Done to 👀 In review in Shannon Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 👀 In review
Development

No branches or pull requests

3 participants