Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] EnumSortOrder.DeclaringOrder in docfx.json doesn't work #9808

Open
Culter opened this issue Mar 21, 2024 · 1 comment
Open

[Bug] EnumSortOrder.DeclaringOrder in docfx.json doesn't work #9808

Culter opened this issue Mar 21, 2024 · 1 comment
Labels
bug A bug to fix

Comments

@Culter
Copy link

Culter commented Mar 21, 2024

Describe the bug
Enum values are always shown in alphabetical order, regardless of the requested order in docfx.json.

To Reproduce
Steps to reproduce the behavior:

  1. Add any of the following attempts to an existing docfx.json file:
    • "enumSortOrder": "declaringOrder"
    • "enumSortOrder": "DeclaringOrder"
    • "EnumSortOrder": "declaringOrder"
    • "EnumSortOrder": "DeclaringOrder"
  2. Note that this property name is not allowed by the published schema at https://json.schemastore.org/docfx.json, but let's try to build the site anyway.
  3. docfx docfx.json --serve

Expected behavior

  1. Enum values should be shown in declaring order.
    • Alternatively, if the current version of the docfx tool doesn't recognize a property specified in the docfx.json file, or if it rejects the syntax of a property, it should output a warning on the command line when it builds the site.
  2. https://json.schemastore.org/docfx.json should be maintained, so that editing a docfx.json file in a modern editor (Visual Studio) helps the author to find the right syntax without trial-and-error.
  3. https://dotnet.github.io/docfx/reference/docfx-json-reference.html#enumsortorder should also be updated with the correct capitalization, whichever it is.

Context (please complete the following information):

  • OS: Windows 10 Pro
  • Docfx version:
>dotnet --version
8.0.200

>docfx --version
4.75.3+a5c719410037cc288c7adff010b1abf3c0f2e581

Additional context
This PR, merged August 2023:

...purports to fix this issue from December 2017:

@BarkenBark
Copy link

BarkenBark commented Apr 9, 2024

  • Where in you docfx.json are you adding "enumSortOrder"? For me, the following works (version 2.75):
  "metadata": [
    {
      // Other stuff
      "enumSortOrder": "declaringOrder"
    }
  ],
  • Your docfx version seems strange. Isn't the latest release 2.76?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

2 participants