Skip to content

strfmt.ObjectId is scanned back as an array of strings #2704

@dimovnike

Description

@dimovnike

Problem statement

The following structure:

// swagger:model
type Scan1 struct {
	ObjectID  strfmt.ObjectId
	ObjectIDP *strfmt.ObjectId
}

is scanned as the following yaml code:

definitions:
  Scan1:
    properties:
      ObjectID:
        items:
          format: bsonobjectid
          type: string
        type: array
      ObjectIDP:
        items:
          format: bsonobjectid
          type: string
        type: array
    type: object
    x-go-package: github.com/go-swagger/go-swagger/test
paths: {}
swagger: "2.0"

Environment

swagger version: v0.29.0-2-g9939a8f0
go version: go1.16.7
OS: linux

pull request will follow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions