cloud-annotations / docusaurus-openapi

🦕 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.netlify.app
MIT License
498 stars 82 forks source link

Support of readonly attributes #254

Open Xusifob opened 1 year ago

Xusifob commented 1 year ago

Currently, some fields of my API are marked as ReadOnly. This is not reflected in the created documentation :

Here is my Schema :

"apiKey": {
                "type": "object",
                "description": "",
                "deprecated": false,
                "properties": {
                    "name": {
                        "description": "The name of your API Key",
                        "example": "production",
                        "type": "string"
                    },
                    "apiKey": {
                        "readOnly": true,
                        "description": "The API Key",
                        "example": "UkD8U2TNWvz56g8z0XdhqQ8ATptBTLdoJI0WFL",
                        "type": "string"
                    },
                    "lastUsage": {
                        "readOnly": true,
                        "description": "The Date you used this API Key for the last time",
                        "example": "2023-07-22T02:00:46+00:00",
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "id": {
                        "readOnly": true,
                        "description": "The unique identifier of your entity",
                        "example": "1ee27e2e-b90b-61f0-80b9-c5b18a3c9c50",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "createdDate": {
                        "readOnly": true,
                        "description": "The Date the entity has been created",
                        "example": "2023-07-22T02:00:46+00:00",
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },

Here is the documentation : image

And the editor on the left :

![Uploading image.png…]()

I am new to this project, I am willing to spend some time trying to fix this issue, if someone can help me to start on how to contribute and where I could find the problematic code

chris48s commented 1 year ago

I'm also pretty new to this project, but the contributing docs are in https://github.com/cloud-annotations/docusaurus-openapi/blob/main/CONTRIBUTING.md and the code that renders the table of parameters is https://github.com/cloud-annotations/docusaurus-openapi/blob/main/packages/docusaurus-plugin-openapi/src/markdown/createParamsTable.ts