fern-api / fern

Input OpenAPI. Output SDKs and Docs.
https://buildwithfern.com
Apache License 2.0
2.69k stars 151 forks source link

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

Open Olshansk opened 10 months ago

Olshansk commented 10 months ago

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
armandobelardo commented 6 months ago

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
b0xtch commented 2 months ago

Facing the same issue tried the suggestion above nada

dsinghvi commented 2 months ago

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