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

IBX-9058: Swap openapi.summary→openapi.description, name→openapi.summary #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Mar 10, 2025

🎫 Issue IBX-9058

Related PRs:

Same fix:

  • ibexa/activity-log#120
  • ibexa/calendar#69
  • ibexa/cart#121
  • ibexa/corporate-account#283
  • ibexa/order-management#146
  • ibexa/payment#168
  • ibexa/product-catalog#1285
  • ibexa/segmentation#124
  • ibexa/shipping#106
  • ibexa/taxonomy#322

Same ticket:

Description:

Before :

  • The name was used as operationId in the export which can't contain spaces, redocly lint was throwing many "Operation operationId should not have URL invalid characters."
  • The extracted schema contained useless generated descriptions.
paths:
  /bookmark:
    get:
      operationId: 'List of bookmarks'
      summary: 'Lists bookmarked Locations for the current user.'
      description: 'Retrieves a BookmarkListController resource.'

After:

  • operationId are generated.
paths:
  /bookmark:
    get:
      operationId: api_bookmark_get
      summary: 'List of bookmarks'
      description: 'Lists bookmarked Locations for the current user.'

Swapping scripts:

For current ibexa/rest

find src/lib/Server/Controller -name '*.php' \
  -exec perl -i -p0e 's/^        summary:/        description:/mgis' {} \; \
  -exec perl -i -p0e 's/^    name:/    summary:/mgis' {} \; \
  -exec perl -i -p0e 's/(    summary: [^\n]+)\n(    openapi: [^\n]+)/$2\n    $1/gis' {} \; \
  -exec perl -i -p0e 's/(    summary: [^\n]+)\n(    extraProperties: [^\n]+)\n(    openapi: [^\n]+)/$2\n$3\n    $1/gis' {} \; \
;

For other packages:

find src/bundle/Controller/REST -name '*.php' \
  -exec perl -i -p0e 's/^        summary:/        description:/mgis' {} \; \
  -exec perl -i -p0e 's/^    name:/    summary:/mgis' {} \; \
  -exec perl -i -p0e 's/(    summary: [^\n]+)\n(    openapi: [^\n]+)/$2\n    $1/gis' {} \; \
  -exec perl -i -p0e 's/(    summary: [^\n]+)\n(    extraProperties: [^\n]+)\n(    openapi: [^\n]+)/$2\n$3\n    $1/gis' {} \; \
;

For QA:

Documentation:

The name was used as operationId which can't contain spaces.
@adriendupuis adriendupuis changed the title Swap openapi.summary→openapi.description, name→openapi.summary IBX-9058: Swap openapi.summary→openapi.description, name→openapi.summary Mar 10, 2025
@adriendupuis adriendupuis marked this pull request as ready for review March 12, 2025 16:54
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.

4 participants