Skip to content

springdoc-openapi-data-rest produces broken schema (Link self ref) for HAL hypermedia types #609

Closed
@ch4mpy

Description

@ch4mpy

Describe the bug
Schema definiton for Link is a reference to itself, leading to StackOverflowError in openapi-generator-cli

versions

  • spring-boot 2.2.6.RELEASE
  • springdoc-openapi-ui and springdoc-openapi-data-rest both in version 1.3.4 & springdoc-openapi-maven-plugin version 0.3

Minimal sample to reproduce

Expected behavior
Schema Link definition is as follow

"Link":{"$ref":"#/components/schemas/Link"}

It should be

"Link": {
	"type": "object",
	"properties": {
	  "href": {
		"type": "string"
	  },
	  "hreflang": {
		"type": "string"
	  },
	  "media": {
		"type": "string"
	  },
	  "title": {
		"type": "string"
	  },
	  "type": {
		"type": "string"
	  },
	  "deprecation": {
		"type": "string"
	  },
	  "profile": {
		"type": "string"
	  },
	  "name": {
		"type": "string"
	  }
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions