openapi-diff: Description & summary of Operations not showing in changelog.
Description
I’ve been testing what this library can and cannot do, and it appears that it does not keep track of description & summary of the operations?
I have also tested this with the description of parameters, and they do update.
It does show the summary directly after the path of the operation, but it only shows the latest one and it does not show it has been changed.
The code
/pets/{id}:
get:
description: A description // This is not in changelog when changed
summary: This is a summary // This is not in changelog when changed
operationId: find pet by id
parameters:
- name: aaadda
in: path
description: Param desc // This is in changelog when changed
required: true
schema:
type: integer
format: int64
Question
Am I correct in that those properties are not in the Changelog? Or am I making a mistake.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (20 by maintainers)
Commits related to this issue
- Suggested fix for https://github.com/quen2404/openapi-diff/issues/60 — committed to msnijder30/openapi-diff by msnijder30 6 years ago
I don’t know, i have some idea to improve code, and it will break the current api. So I want to make this changes before release 2.0.0 ! Not big changes, but enough to break compatibility !
Snapshot version is not available currently 😐
@msnijder30 i only add support in diff result, not on the ouput (markdown, html, console). Because i’m working on another branch to improve the output globally (not only for summary/description)
I’m working on it in the branch feature/summary-description, but work is in progress.
Hello, i opened the project this morning ! I’m working on it !
Hi, I had some time, looked at the code and made something.
What’s new
I’ve added the classes
OperationMetadataDiffandChangedOperationMetadata. These classes keep track of changes made insummary&description.I’ve also added the setting
showChangedMetadatatoMarkdownRenderer, which isfalseby default, this is the option which will enable descriptive changes.The changed markdown
As you can see there is an
Metadatafield as first item below the operation. This contains the summary & description. If only the summary has changed it will only show the summary, same for the description.If
showChangedMetadatais enabled and if there are changes the markdown file looks as follows:Example code
All commits related to this feature
OpenApiDiffto have more Lombok)Questions
metadatato describe thesummary&description?ChangedOperationMetadata#isChangedI’m not sure if there also should be anINCOMPATIBLEoption since it is compatible withOpenAPI 2.0but not withOpenAPI 1.2, in 1.2 there is nodescriptionfield. It should be backwards compatible though since it will just see that thedescriptionfield isnulland will not include it into the changelog.summaryshould still work.Looking forward to your reaction, if you think this is a good idea I’ll make a pull request, if you have any suggestion for changes I’ll add those.
If you think it’s a bad idea that’s okay aswell 👍
It depends on what is your definition of quick 😉 I’m a little busy today and this weekend, but i think i will have time to do this next week.
Ok, in my company we only use the Markdown output. I will update HtmlRender to output the same details. But as i mentionned in my previous response, this kind of changes are only descriptive. I understand you want to see all changes in the changelog 😃 So as a compromise, we can add an option to output this kind of descriptive changes in the changelog !