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

docfx init puts external cross reference services under build.xref instead of build.xrefService #5053

Closed
stakx opened this issue Sep 1, 2019 · 1 comment
Labels
xref Cross reference another document using unique IDs

Comments

@stakx
Copy link

stakx commented Sep 1, 2019

Operation System: Windows

DocFX Version Used: 2.45

Template used: default

Steps to Reproduce:

  1. Run docfx init and answer the question about external API references with https://xref.docs.microsoft.com/query?uid={uid}:

    C:\Projects> docfx init
    ...
    Do you want to specify external API references?
    Supported external API references can be in either JSON or YAML format.
    Press ENTER to move to the next question.
    https://xref.docs.microsoft.com/query?uid={uid}

    ...
    Successfully generated default docfx project to C:\Projects\docfx_project

  2. Inspect the generated docfx.json. Take note of where the cross reference service URL was put.

Expected Behavior:

The cross service reference URL https://xref.docs.microsoft.com/query?uid={uid} should be put under $.build.xrefService, as per the documentation.

Actual Behavior:

The cross service reference URL is put under $.build.xref. This will cause external cross references to be unresolved in generated documentation. I am seeing these warnings during a build:

Warning:[BuildCommand.LoadSchemaDrivenDocumentProcessors]Unable to download xref map file from https://xref.docs.microsoft.com/query?uid={uid}, details: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): No node deserializer was able to deserialize the node into type Microsoft.DocAsCode.Build.Engine.XRefMap, Microsoft.DocAsCode.Build.Engine, Version=2.45.0.0, Culture=neutral, PublicKeyToken=null

Warning:[BuildCommand.BuildCore.Build Document]Unable to download xref map file from https://xref.docs.microsoft.com/query?uid={uid}, details: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): No node deserializer was able to deserialize the node into type Microsoft.DocAsCode.Build.Engine.XRefMap, Microsoft.DocAsCode.Build.Engine, Version=2.45.0.0, Culture=neutral, PublicKeyToken=null

If I manually edit docfx.json and rename $.build.xref to $.build.xrefService, the warnings disappear and BCL cross references are correctly resolved.

@superyyrrzz
Copy link
Contributor

This hint only means to udpate xref instead of xrefService, but I agree it need to update the message to avoid confusing user with two similar configurations.

Some thoughts:

  1. Add xref service by default. This should be what most users expect.
  2. Hint user xrefService is already set by default. Here only needs xref file.

@yufeih yufeih added xref Cross reference another document using unique IDs and removed enhancement labels Dec 15, 2022
@yufeih yufeih closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
xref Cross reference another document using unique IDs
Projects
None yet
Development

No branches or pull requests

3 participants