fern icon indicating copy to clipboard operation
fern copied to clipboard

[OpenAPI Bug] ConflictError due to `already declared in service.yml`

Open Olshansk opened this issue 1 year ago • 3 comments

Describe the Bug

We're hitting the following issue in this PR: pokt-network/poktroll/pull/344

[api]: Found 5 errors and 6 warnings. Run fern check --warnings to print out the warnings.
[api]: __package__.yml -> types -> CosmosTxV1Beta1BroadcastTxRequestMode
       CosmosTxV1Beta1BroadcastTxRequestMode is already declared in service.yml
[api]: __package__.yml -> types -> CosmosTxV1Beta1BroadcastTxRequest
       CosmosTxV1Beta1BroadcastTxRequest is already declared in service.yml
[api]: __package__.yml -> types -> CosmosTxV1Beta1TxDecodeAminoRequest
       CosmosTxV1Beta1TxDecodeAminoRequest is already declared in service.yml
[api]: __package__.yml -> types -> CosmosTxV1Beta1TxDecodeRequest
       CosmosTxV1Beta1TxDecodeRequest is already declared in service.yml
[api]: __package__.yml -> types -> CosmosTxV1Beta1TxEncodeAminoRequest
       CosmosTxV1Beta1TxEncodeAminoRequest is already declared in service.yml

We managed to circumvent it by commented out large blocks of yaml in the auto-generate OpenAPI spec built by cosmos.network/sdk

But believe it shouldn't be an issue based on [1] & [2]. Is our expectation inaccurate

[1] https://github.com/fern-api/fern/issues/2374 [2] https://github.com/fern-api/fern/pull/2550

Information to Reproduce

CLI Version

{
    "organization": "olshansk",
    "version": "0.16.36"
}

Generator Config

default-group: local
groups:
  local:
    generators:
      - name: fernapi/fern-typescript-node-sdk
        version: 0.7.2
        output:
          location: local-file-system
          path: ../sdk/typescript
      - name: fernapi/fern-go-sdk
        version: 0.9.4
        config:
          module:
            path: github.com/pokt-network/poktroll
            version: "1.19"
        output:
          location: local-file-system
          path: ../sdk/go

Olshansk avatar Jan 26 '24 22:01 Olshansk

This may actually be resolved, if you could retry this on the latest version of the Fern CLI (fern upgrade), and if necessary adding this configuration to the generation:

api:
  path: ./openapi/openapi.yaml
  settings:
    use-title: false             # <-- this is the important configuration

armandobelardo avatar May 27 '24 10:05 armandobelardo

Facing the same issue tried the suggestion above nada

b0xtch avatar Sep 14 '24 16:09 b0xtch

@b0xtch do you mind pasting your OpenAPI spec here? If not, please feel free to join our slack community and dm me!

dsinghvi avatar Sep 14 '24 22:09 dsinghvi