Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ch4mpy opened this issue Apr 24, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ch4mpy
Copy link

ch4mpy commented Apr 24, 2020

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"
	  }
	}
}
@bnasslahsen
Copy link
Collaborator

@ch4mpy,

Its now fixed. You can test with the lastest snapshot and give your feedback.

@ch4mpy
Copy link
Author

ch4mpy commented Apr 25, 2020

@bnasslahsen Using 1.3.5-SNAPSHOT, I could generate Angular code from Spring project without hacking intermediate schema.

Thank you!

@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants