Skip to content
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

Spring cloud contract with content type application/x-ndjson #2123

Open
FlxGschlr opened this issue Jun 28, 2024 · 0 comments
Open

Spring cloud contract with content type application/x-ndjson #2123

FlxGschlr opened this issue Jun 28, 2024 · 0 comments

Comments

@FlxGschlr
Copy link

FlxGschlr commented Jun 28, 2024

Describe the bug
The stub response body is incorrect if the content-type "application/x-ndjson" is used. An identical problem has been described in #1535.

"application/stream+json" has been deprecated and my team is using "application/x-ndjson" instead (recommendation in the spring restdocs). As mentioned in #1535 the generated stub only returns the first element now.

You can reproduce the issue by changing the content-type to "application/x-ndjson" in the following test:

       @Issue("#1535")
	def "should work with streams"() {
		given:
			Contract contractDsl = Contract.make {
				description "should return all entities"
				request{
					method GET()
					url("/api/v1/entities")
				}
				response {
					headers {
						header 'Content-Type': 'application/stream+json'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants