Skip to content

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented Mar 25, 2025

If you scaffold a chain without a module, the openapi.yml file will not be generated, and the chain will be broken because this file is embedded into the code

//go:embed static
var Static embed.FS

@Pantani Pantani force-pushed the fix/missing-doc-file branch from 3aaf432 to 2175512 Compare March 25, 2025 18:45
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Do you have steps to reproduce?
Using --no-module generates an openapi.yml to me:

{
  "id": "gm",
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "swagger": "2.0",
  "info":
    {
      "description": "Chain gm REST API",
      "title": "HTTP API Console",
      "contact": { "name": "gm" },
      "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" },
            },
        },
    },
}

@julienrbrt
Copy link
Member

I see it failing in the two other PRs you have in CI, but when i try locally from HEAD of main, or run TestGenerateAnAppWithNoDefaultModule from HEAD of main it works.

@Pantani
Copy link
Collaborator Author

Pantani commented Mar 26, 2025

I see it failing in the two other PRs you have in CI, but when i try locally from HEAD of main, or run TestGenerateAnAppWithNoDefaultModule from HEAD of main it works.

weird, it is falling locally here as well. try to run the TestGenerateAnAppWithNoDefaultModule test function

@Pantani Pantani requested a review from julienrbrt March 26, 2025 00:09
@Pantani
Copy link
Collaborator Author

Pantani commented Mar 26, 2025

Ohh, sorry, I got it. I force the skipProto flag to be true if I don't have any module in #4588 and #4595. The reason is that we don't have any proto files to build and run in buf format. I used these branches

@Pantani Pantani requested a review from julienrbrt March 26, 2025 05:12
@julienrbrt julienrbrt changed the title fix: missing openapi.yml static doc refactor: add default openapi.yml when skipping proto gen Mar 26, 2025
@julienrbrt julienrbrt merged commit 1c29f9b into main Mar 26, 2025
40 of 44 checks passed
@julienrbrt julienrbrt deleted the fix/missing-doc-file branch March 26, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants