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

fix: hydra:view example values #4681

Merged
merged 1 commit into from
Apr 7, 2022
Merged

Conversation

divine
Copy link
Contributor

@divine divine commented Mar 14, 2022

Q A
Branch? main
Tickets #4354 #4394 #4667
License MIT
Doc PR api-platform/docs#...

Hi,

I went ahead and checked what's the reason for this issue.

I can confirm that this is a Redoc issue that when property contains format "iri-reference"

hydra:view propery
{
  "hydra:view": {
  	"type": "object",
  	"properties": {
  		"@id": {
  			"type": "string",
  			"format": "iri-reference"
  		},
  		"@type": {
  			"type": "string"
  		},
  		"hydra:first": {
  			"type": "string",
  			"format": "iri-reference"
  		},
  		"hydra:last": {
  			"type": "string",
  			"format": "iri-reference"
  		},
  		"hydra:previous": {
  			"type": "string",
  			"format": "iri-reference"
  		},
  		"hydra:next": {
  			"type": "string",
  			"format": "iri-reference"
  		}
  	}
  }
}
{"type": "string", "format": "iri-reference"}

it's basically returns sample values:

function iriReferenceSample() {
  return '../словник';
}

If you remove "iri-reference" from the property, everything shows correctly.

The solution would be:

  1. Remove iri-reference from hydra:view property (which isn't nice).
  2. Add example values to hydra:view

This PR contains the 2. changes but it's kinda a BC probably.

Let me know if everything looks good.

Thanks!

@soyuka
Copy link
Member

soyuka commented Apr 6, 2022

Thanks @divine I'm planing to merge this, wdyt @dunglas ?

@soyuka soyuka merged commit 21ba5d5 into api-platform:main Apr 7, 2022
@soyuka
Copy link
Member

soyuka commented Apr 7, 2022

Thanks @divine !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants