Skip to content

openapi: Error: ReadMe API error: An API reference by that name already exists. Did you mean to update that one instead? #1393

@behnam-oneschema

Description

@behnam-oneschema

I have these a few readmeio/rdme@v10 steps in my workflow job, with exactly the parameters, except the file name and slug value:

  - name: "Deploy OAS: Templates"
    uses: readmeio/rdme@v10
    with:
      rdme: >
        openapi upload --key=${{ secrets.README_API_KEY }}
          --confirm-overwrite --slug=templates.json
          docs/external_api/templates.yaml

  - name: "Deploy OAS: Workflows"
    uses: readmeio/rdme@v10
    with:
      rdme: >
        openapi upload --key=${{ secrets.README_API_KEY }}
          --confirm-overwrite --slug=workflows.json
          docs/external_api/workflows.yaml

These steps fail randomly with the this error:

Error: ReadMe API error: An API reference by that name already exists. Did you mean to update that one instead?

If you intended to update this API you should use the `updateAPI` operation instead.

Looking at https://github.com/readmeio/rdme/blob/next/documentation/commands/openapi.md#rdme-openapi-upload-spec, I see that it clearly says "Upload (or re-upload) your API definition", meaning that it's correct to use openapi upload for updating the resources.

And, I've already set --confirm-overwrite, to avoid asking for confirmation from command-line.

This looks like a bug in this action, or something going wrong on the API server side.


Example from a recent run:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions