Git Product home page Git Product logo

Comments (2)

miguelangel-dev avatar miguelangel-dev commented on June 2, 2024 1

Ey @ferranpujolcamins ! You are putting on limit the library, nice!

Currently, we do not support OneOf, but you can use enum; I know you can not use it with associated complex types, but maybe you can find a workaround (think about it as DTO)... I will show you an example:

Given the next Apple SignIn service: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens

You can look at the field grant_type, defined as enum in order to restrict possibilities for requests.

AppleSignInAuth:
      type: object
      required:
        - client_id
        - client_secret
        - grant_type
        - code
        - redirect_uri
      properties:
        client_id:
          type: string
          description: The application identifier for your app.
        client_secret:
          type: string
          description: A secret generated as a JSON Web Token that uses the secret key generated by the WWDR portal.
        grant_type:
          type: string
          description: The grant type that determines how the client interacts with the server. For authorization code validation, use authorization_code. For refresh token validation requests, use refresh_token.
          enum:
            - authorization_code
            - refresh_token
        code:
          type: string
          description: The authorization code received from your application’s user agent. The code is single use only and valid for five minutes.
        redirect_uri:
          type: string
          description: The destination URI the code was originally sent to. It must include a domain name, and can’t be an IP address or localhost.

Another example, in the response: https://developer.apple.com/documentation/sign_in_with_apple/errorresponse

We could define the error as

AppleSignInError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A string that describes the reason for the unsuccessful request. The string consists of a single allowed value.
          enum: 
            - invalid_request
            - invalid_client
            - invalid_grant
            - unauthorized_client
            - unsupported_grant_type
            - invalid_scope

from bow-openapi.

truizlop avatar truizlop commented on June 2, 2024

Thanks for reporting! We'll take a look, but it may be due to the underlying tool we are using.

from bow-openapi.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.