ContributionsMost RecentMost LikesSolutionsHow to document HATEOAS in the OpenAPI specification Hi Team, I have a REST API with a HATEOAS concept, may I know how can I document it in OpenAPI specifications? I tried in the following way[1] links directing to link schema under the component sections, paths: /items/{itemId}: get: responses: '200': description: Successful response content: application/json: schema: type: object properties: itemId: type: integer itemName: type: string links: type: array items: $ref: '#/components/schemas/Link' components: schemas: Link: type: object properties: rel: type: string href: type: string later I got to know about the Link section in the response https://swagger.io/docs/specification/links/ , May I know which approach is suitable for the HATEOAS mapping in REST API. Re: How to contribute `Generate Client` option for Swagger online editor with third party language Hi KJans , Thank you so much for the information 🙂. How to contribute `Generate Client` option for Swagger online editor with third party language Hi Team, We are currently developing a client for the Ballerina language which is an open-source, cloud-native programming language specifically designed to simplify integration development for enterprise applications. We use OpenAPI specification for generating a client via tool. We are interested in adding this client generation tool to the "Generate Client[1]" panel in swagger editor UI. [1] Generate Client panel in swagger editor UI Could you please provide us with guidance on the process for contributing to this swagger editor panel? Thanks Pattern property validation in swagger parser Hi Team, I'm using the Swagger parser for my tooling implementation, and I have a requirement for regex pattern validation since the Swagger specification supports ECMA flavor regex patterns. I would like to have some parser validation errors if we provide an invalid regex pattern to the OpenAPI specification. ex: ``` openapi: ... components: schemas: Person: type: object properties: name: type: string pattern: /(?<!or)ange/g ... ``` This given pattern is invalid in `/(?<!or)ange/g` in ECMA https://regex101.com/r/jjIQfL/1/ , I'm unable to get those details from the current swagger parser. Could you please let me know whether there is a way I can get this validation through the Swagger parser? Swagger Operation Request body definition map for any payload type Hi Team, I'm looking for writing OpenAPI specification for ballerina service which has any type of request payload. Could you please let me know how can I represent accepted any type of payload from OpenAPI specification ? Cloud you please let me know the definition for below openapi scenarios? scenario 01: content with wild card with schema object - here swagger UI gives example as {} paths: /: post: operationId: operation_post requestBody: content: '*/*': schema: type: object scenario 02: content with wild card with schema empty - here swagger UI gives example as string paths: /: post: operationId: operation_post requestBody: content: '*/*': schema:{} scenario 03: content with wild card without schema paths: /: post: operationId: operation_post requestBody: content: '*/*': example: summary: Any type of entity body Re: How to document multiple data types array in OpenAPI Definition Thank you HKosova , This solution fits to my requirement of tool 🙂 What does it mean if we are having a wildcard "*/*" for request body in operation in OpenAPI Hi Team, I 'm having few concern regarding using wildcard */* in request body. scenario 01 : in here having wild card represent it can be `image/png`, `image/svg`, `image/gif`, etc. and */* represents all types and is functionally equivalent to application/octet-stream. by referring OpenAPI spec here paths: /avatar: put: summary: Upload an avatar requestBody: content: image/*: schema: type: string format: binary scenario 02 : Having a wild card without giving schema type requestBody: description: Any request content: "*/*": example: summary: "Any type of entity body" Cloud you please let me know is the scenario 02 also equivalent to scenario 01 or scenario 02 equivalent to any payload can be have as requestBody example `image/png`, `application/json`, `appilcation/xml` etc.? How to document multiple data types array in OpenAPI Definition Hi all, I'm looking for an OpenAPI representation for an array type when the array has one specific data type item at one time, the array data type can be multiple types. That means as an example: let's assume I have an array called `arry` with two data types integer and string, when I receive `arry`, It can be contained items only one type. It can be an integer array(arry[] -> [integer, integer, integer]) or string array (arry[]-> [string, string, string]). If I use oneOf data model : .... arry: type: array items: oneOf: - type: string - type: integer it will return the mixed type array arry[]->[integer, string, integer, integer, string] Could you please let me know, how can I represent array arry[] -> [integer, integer, integer] or arry[]-> [string, string, string] in the OpenAPI definition? Solved