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(JsonSchema): fix reDoc json sample values #5638

Merged
merged 4 commits into from
Oct 17, 2023
Merged

fix(JsonSchema): fix reDoc json sample values #5638

merged 4 commits into from
Oct 17, 2023

Conversation

ERuban
Copy link
Contributor

@ERuban ERuban commented Jun 21, 2023

Q A
Branch? 3.1
Tickets -
License MIT

Actually it fixes the same bug as in that PR but for JSON.

image

@ERuban ERuban changed the title fix: reDoc json example values fix: reDoc json sample values Jun 21, 2023
@ERuban ERuban changed the title fix: reDoc json sample values fix(JsonSchema): reDoc json sample values Jun 21, 2023
@ERuban ERuban changed the title fix(JsonSchema): reDoc json sample values fix(JsonSchema): fix reDoc json sample values Jul 9, 2023
@ERuban
Copy link
Contributor Author

ERuban commented Jul 14, 2023

@soyuka 👋

@ERuban
Copy link
Contributor Author

ERuban commented Aug 25, 2023

@soyuka hey, what about this PR?
Have rebased it to the fresh 3.1

@soyuka
Copy link
Member

soyuka commented Oct 17, 2023

tests are failing

- fix(JsonSchema): reDoc json sample values
- fix(JsonSchema): reDoc json sample values
@ERuban
Copy link
Contributor Author

ERuban commented Oct 17, 2023

tests are failing

@soyuka done. The last one seems not related to my changes.

@soyuka soyuka merged commit 7afdabb into api-platform:3.1 Oct 17, 2023
25 of 28 checks passed
@soyuka
Copy link
Member

soyuka commented Oct 17, 2023

thanks!

soyuka pushed a commit to soyuka/core that referenced this pull request Oct 18, 2023
* fix(jsonschema): fix reDoc json sample values

* fix(JsonSchema): reDoc json sample values

* fix-redoc-json-example-values

- fix(JsonSchema): reDoc json sample values

* fix-redoc-json-example-values

- fix(JsonSchema): reDoc json sample values
@@ -139,7 +139,7 @@ private function getClassType(?string $className, bool $nullable, string $format
if (true !== $readableLink && $this->isResourceClass($className)) {
return [
'type' => 'string',
'format' => 'iri-reference',
'format' => 'iri-template',
Copy link
Member

@soyuka soyuka Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've a problem with that it's not in the specification: https://json-schema.org/understanding-json-schema/reference/string#resource-identifiers isn't redoc wrong?

we should fix this by introducing an example section instead imo

soyuka added a commit that referenced this pull request Oct 18, 2023
@soyuka
Copy link
Member

soyuka commented Oct 18, 2023

I reverted that.

soyuka added a commit that referenced this pull request Oct 18, 2023
@dunglas
Copy link
Member

dunglas commented Oct 18, 2023

@soyuka you're right. We don't generate templates here but references. The patch was wrong (maybe there is a bug in ReDoc, but then ReDoc must be patched, not our code).

@soyuka
Copy link
Member

soyuka commented Oct 18, 2023

I think what we need is to add examples if we really want this feature on docs.

@ERuban
Copy link
Contributor Author

ERuban commented Oct 18, 2023

ok, got it. let me try to add examples then

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.

3 participants