question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown type for the following structure (type: string, class: io.swagger.v3.oas.models.media.PasswordSchema)

See original GitHub issue

Update This issue is tracking errors generated by following schemas:

swagger: "2.0"
info:
  title: Whatever
  version: 1.0.0
host: localhost:1234
schemes:
  - http
definitions:
  Foo:
    type: object
    properties:
      somePassword:
        type: string
        format: password
      someFile:
        type: file
      someBinary:
        type: string
        format: binary

They all generate errors similar to this one:

Error: Unknown type for the following structure (type: string, class: io.swagger.v3.oas.models.media.PasswordSchema):
  class PasswordSchema {
      class Schema {
      }
      type: string
      format: password
  }

Original issue:

Hi,

when using follwing definition:

{"password":{"format":"password","type":"string"}}

I get the following error:

Error: Unknown type for the following structure (type: string, class: io.swagger.v3.oas.models.media.PasswordSchema):
  class PasswordSchema {
      class Schema {
      }
      type: string
      format: password
  }

Any idea what to do about it? I suspect it’s a format that has been removed in swagger v3 or something like that

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
tomashermancommented, May 5, 2019

@Gipetto i believe i patched this issue with #283 but i think further improvements on how binary properties should be handled are in order

0reactions
blast-hardcheesecommented, Feb 20, 2022

#1407 improves the situation referred to by @nick-bauer – I unified the different type transformation logic, which was causing issues with $refs inside of array.

Closing this, thank you 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown type for the following structure (type: string, class: io ...
Unknown type for the following structure (type: string, class: io.swagger.v3.oas.models.media.PasswordSchema) #255.
Read more >
Data Types - Swagger
OAS 3 This guide is for OpenAPI 3.0. Data Types. The data type of a schema is defined by the type keyword, for...
Read more >
Swagger declaration schema = @Schema(implementation ...
I have one API endpoint, the request body expects a HashMap. There is not much information on how to fix the "Example value"...
Read more >
Uses of Class io.swagger.v3.oas.models.media.StringSchema
Methods in io.swagger.v3.oas.models.media that return StringSchema. Modifier and Type, Method and Description. StringSchema, StringSchema.
Read more >
Uses of Class io.swagger.v3.oas.models.media.Schema
returns the schemas property from a Components instance. Methods in io.swagger.v3.oas.models with parameters of type Schema. Modifier and Type ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found