Redocly / Redocly/redoc

add sortOperationsAlphabetically config, html show error

Open
#2,518 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

sorry first, my english is not good

Describe the bug

i add sortOperationsAlphabetically is true in redocly.yaml then build html file.

but summary field and description field show order error.

use this code can reappear

Expected behavior

show content same as yaml file

Minimal reproducible OpenAPI snippet(if possible)

test.yaml file content:

info:
    title: Api
    version: "0.1"
paths:
    /internal/clear_cache:
        post:
            description: 清空缓存
            operationId: 清空缓存
            responses:
                "200":
                    $ref: '#/responses/NoDataResponseSwagger'
            summary: 清空缓存
            tags:
                - internal
    /internal/unbind_account_all:
        post:
            description: 将账号下的所有绑定关系解绑
            operationId: UnbindAccountAllReqSwagger
            responses:
                "400":
                    $ref: '#/responses/NoDataResponseSwagger'
            summary: 解绑账号所有隐私号
            tags:
                - internal
responses:
    NoDataResponseSwagger:
        description: ""
        schema:
            type: object
schemes:
    - https
swagger: "2.0"

redocly.yaml file content:

extends:
  - recommended

apis:
  test:
    root: test.yaml

theme:
  openapi:
    hideDownloadButton: true
    schemaExpansionLevel: 3
    sortPropsAlphabetically: true
    sortTagsAlphabetically: true
    sortOperationsAlphabetically: true

run command:

docker run --rm -v `pwd`:/app -w /app redocly/cli build-docs -o test.html --disableGoogleFont=true test

Screenshots

image

this file has 2 problem:

  1. show message is error
  2. show response code is error

I delete sortOperationsAlphabetically field in redocly.yaml, success

excuse my bad english, thinks.

Additional context

none

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided test.yaml and redocly.yaml files, then run the documented Docker build-docs command with sortOperationsAlphabetically enabled. Compare the generated test.html with the YAML ordering, focusing on the summary, description, and response code. Done means the displayed content and response code match the source YAML.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.