redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

Fix joining paths with metadata

Open TejasQ opened this issue 3 years ago • 5 comments

What/Why/How?

The join command assumes all paths have only operations that are expected to be objects, but paths can also have string fields like summary and description. This PR only treats objects as objects.

Reference

https://swagger.io/docs/specification/paths-and-operations/#:~:text=In%20OpenAPI%20terms%2C%20paths%20are,as%20GET%2C%20POST%20or%20DELETE.

image

Testing

There are no tests for this file, so no tests were added.

Screenshots (optional)

Check yourself

  • [x] Code is linted
  • [x] Tested with redoc/reference-docs/workflows
  • [] All new/updated code is covered with tests

Security

  • [x] Security impact of change has been considered
  • [x] Code follows company security practices and guidelines

TejasQ avatar Jan 28 '22 11:01 TejasQ

Thanks @TejasQ for raising the issue and providing a solution.

The path item object can also have a parameters object at the top level.

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object

We should solve that as well.

adamaltman avatar Jan 30 '22 02:01 adamaltman

Thanks @TejasQ for raising the issue and providing a solution.

The path item object can also have a parameters object at the top level.

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object

We should solve that as well.

Please do 🙏 Thanks for your effort 🙇

alesbrelih avatar Feb 02 '22 19:02 alesbrelih

So who does “we” in “we should solve that as well” exactly refer to? 😬

TejasQ avatar Feb 09 '22 18:02 TejasQ

image

(We're deep into some other projects, and I hope we can get to this within a few weeks. I'll see if anyone else on the team can hop in.)

adamaltman avatar Feb 09 '22 18:02 adamaltman

Hi,

The path item object can also have a parameters object at the top level.

OAI/OpenAPI-Specification@main/versions/3.0.3.md#path-item-object

We should solve that as well.

Is this really a blocker for this PR? The change looks rather minimal and it is solving an actual bug. Is there a chance to get it in and we create an issue for the path item object?

urso avatar Jun 24 '22 07:06 urso

Hi @TejasQ, thanks for the PR.

Based on this PR we created this one to handle all possible fields in a PathItem object

IgorKarpiuk avatar Aug 29 '22 08:08 IgorKarpiuk