mardi 23 juillet 2019

How to verify if passwords match, with swagger and yarn in node.js?

Trying to avoid writing multiple if-statements with my signup page. In one case I want to check if the sign up form is validated, based on username and password. Is there a way to do this with yarn and Swagger for my test case?

Someone has indicated that I should reference OpenApi/Swagger. So, I've checked out the Auth Flows Object in OpenAPI specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#discriminatorObject

However, I'm still a little stumped on where to start.

type: oauth2
flows: 
  implicit:
    authorizationUrl: https://example.com/api/oauth/dialog
    scopes:
      write:pets: modify pets in your account
      read:pets: read your pets
  authorizationCode:
    authorizationUrl: https://example.com/api/oauth/dialog
    tokenUrl: https://example.com/api/oauth/token
    scopes:
      write:pets: modify pets in your account
      read:pets: read your pets 

The ultimate goal is to sign up/sign in with Keycloak. However I need to have some predefined validation with OpenAPI via yarn I believe. Someone please guide me if that is off base.

If I'm on the right track. Which object should I use for this case?

Aucun commentaire:

Enregistrer un commentaire