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

externalDocs support for the auto-generated PowerShell reference documents #876

Closed
Tracked by #257
maisarissi opened this issue Sep 24, 2021 · 6 comments · Fixed by #2697
Closed
Tracked by #257

externalDocs support for the auto-generated PowerShell reference documents #876

maisarissi opened this issue Sep 24, 2021 · 6 comments · Fixed by #2697
Assignees
Milestone

Comments

@maisarissi
Copy link

maisarissi commented Sep 24, 2021

  1. Find a way of linking from the PowerShell reference page back to the API reference page.

  2. Human written content in API reference page that describes the purpose of the cmdlet/api is not being migrated. Links also need to be migrated to PowerShell reference page.

  • Extract the right information that we have in the API page:
    image.png
    image.png

  • And than, use it as the first paragraph.
    image.png

    The current information is being retrieved from the relationships session on the doc page:
    image.png

  1. Some parameters/properties are not bringing the right description from the API page. (Enum for sure, maybe others too)

image

image

@ghost ghost added the ToTriage label Sep 24, 2021
@maisarissi maisarissi self-assigned this Sep 24, 2021
@ghost ghost removed the ToTriage label Sep 24, 2021
@maisarissi maisarissi assigned georgend and unassigned maisarissi Sep 24, 2021
@peombwa peombwa added this to the 11/21 milestone Oct 26, 2021
@peombwa peombwa modified the milestones: 11/21, 12/21 Dec 7, 2021
@georgend
Copy link
Contributor

These all map to Operation descriptions in the OpenAPI:
PATCH on a collection: Autogenerate description when DeepInsertSupport or DeepUpdateSupport is present.
PATCH/PUT on a collection item: Use UpdateRestrictions.Description
GET on a collection: Use ReadRestrictions.Description.
GET on collection item: Use ReadRestrictions.ReadRestrictionByType.Description
POST on a collection: InsertRestriction.Description
DELETE on collection item: DeleteRestrictions.Description

OpenAPI PathItem descriptions are autogenerated and are used by the CLI tooling for things like e.g. mgc applications -h .

Relevant Capability Annotations:
https://github.com/oasis-tcs/odata-vocabularies/blob/758e454f012dd50de1f96a51953054ead7ad4656/vocabularies/Org.OData.Capabilities.V1.md#ReadRestrictionsType
https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#UpdateRestrictionsType

Actions:
@georgend to use ApiDoctor to inject from documentation into the CSDL metadata
@irvinesunday to implement conversion to OpenAPI for operation descriptions in OpenApi.Net.OData library.

@maisarissi
Copy link
Author

Hey @georgend . As part of our discussion, one of the things we want to investigate is whether is possible to use DevX API permissions endpoint (same endpoint used by @peombwa in the Find-MgGraphCommand) as part of our docs generation to fix #132.

@maisarissi
Copy link
Author

maisarissi commented Feb 22, 2022

Hi @georgend .
As part of the ask I mentioned

Find a way of linking from the PowerShell reference page back to the API reference page.

I was talking to @darrelmiller about linking back to the API page as part of this effort, so I was wondering whether you are going to open a new PR in the APIDoctor to address it or update the existing one.
Can you help me clarify it?

@darrelmiller
Copy link
Contributor

darrelmiller commented Feb 28, 2022

Ping @georgend Getting this link into the metadata is going to drive a lot of downstream functionality. It is really important that we get this in ASAP.

@peombwa
Copy link
Member

peombwa commented Jun 2, 2022

@peombwa
Copy link
Member

peombwa commented Jun 21, 2022

To have links supported in the command reference, the following prerequisites must be met first:

  1. ApiDoctor will need to inject the CSDL metadata with Links annotation. Improve APIDoctor to get information from the docs and add them to the metadata using the right annotations OneDrive/apidoctor#114.
  2. OpenAPI.NET.OData will need to support converting the OData links annotation to OpenAPI externalDocs property of an operation object. Add the documentation links from Links annotations in CSDL to OpenAPI Operations  microsoft/OpenAPI.NET.OData#230. (July timeframe).
  3. AutoREST.PowerShell will need to support externalDocs on an operation object. [Feature Request] OpenAPI externalDocs on an operation object support Azure/autorest.powershell#960.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment