OpenAPI Integration

Similar to building on Express.js, you can also build the same APIs with OpenAPI. There is only one additional field x-nuc-action that is triggered when the API has been called, which run the action function inside the Nucleoid runtime.

POST https://l…


This content originally appeared on DEV Community and was authored by Can Mingir

Similar to building on Express.js, you can also build the same APIs with OpenAPI. There is only one additional field x-nuc-action that is triggered when the API has been called, which run the action function inside the Nucleoid runtime.

POST https://localhost:8448/openapi

{
  "api": {
    "/": {
      "get": {
        "summary": "Hello World",
        "description": "Hello World",
        "params": [
          {
            "name": "example",
            "in": "query",
            "type": "string",
            "required": false,
            "description": "example"
          }
        ],
        "request": {
          "type": "object",
          "properties": {}
        },
        "response": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            }
          }
        },
        "x-nuc-action": "function action(req) { return { message: 'Hello World' }; }"
      }
    }
  }
}


This content originally appeared on DEV Community and was authored by Can Mingir


Print Share Comment Cite Upload Translate Updates
APA

Can Mingir | Sciencx (2022-07-23T14:18:00+00:00) OpenAPI Integration. Retrieved from https://www.scien.cx/2022/07/23/openapi-integration/

MLA
" » OpenAPI Integration." Can Mingir | Sciencx - Saturday July 23, 2022, https://www.scien.cx/2022/07/23/openapi-integration/
HARVARD
Can Mingir | Sciencx Saturday July 23, 2022 » OpenAPI Integration., viewed ,<https://www.scien.cx/2022/07/23/openapi-integration/>
VANCOUVER
Can Mingir | Sciencx - » OpenAPI Integration. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/23/openapi-integration/
CHICAGO
" » OpenAPI Integration." Can Mingir | Sciencx - Accessed . https://www.scien.cx/2022/07/23/openapi-integration/
IEEE
" » OpenAPI Integration." Can Mingir | Sciencx [Online]. Available: https://www.scien.cx/2022/07/23/openapi-integration/. [Accessed: ]
rf:citation
» OpenAPI Integration | Can Mingir | Sciencx | https://www.scien.cx/2022/07/23/openapi-integration/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.