CASMCMS-8959: Correct errors in API spec #112
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This corrects several errors I found when reviewing the CFS API spec recently:
description
fields have minor errors (usually seemed to be copy-paste errors when the schema was created based on another schema). A couple ofexample
fields had the same issue.Version
schema claims that themajor
,minor
, andpatch
fields are integers, but in truth CFS has always returned them as string values. Looking at the source code, I can see why. Given that CFS has always behaved this way, it seems better to update the API spec to reflect reality, rather than change the API behavior.summary
anddescription
texts) that they return lists of versions, but in truth they just return the current version.next
field is null when there are not additional pages. The API spec does not convey that this field may take a null value.V3SessionIdCollection
schema says it is a list of sessions, but as the name implies, it actually is a list of session IDs. The actual CFS behavior reflects this.components
, even though it actually varies based on the endpoint being paginated).$ref
and specified options as siblings of it. However, in OAS 3.0.x, any siblings of a$ref
are ignored. For example, if you say that a given property follows some schema (by using a$ref
) but then also list that this property isreadOnly
ornullable
, those latter options are ignored. In OAS 3.0.x, there are two ways this is generally handled.allOf
, listing the referenced schema, and then an empty schema which has the other desired values. This option in some ways is the cleanest choice, but unfortunately a number of people have reported that a lot of tools do not handle parsing it very well. Because of that, I opted to do:Most of them are updates to schemas which the actual CFS code never uses, and thus will have no functional impacts. Only two of the changes impact schemas which are used by the code (
V2ComponentState
andVersion
). I reviewed the code that uses these models to make sure that the changes should not impact them. I also deployed this on mug and ran both manual CFS tests and thecmsdev
CFS regression tests, and verified that it worked.Backports:
CSM 1.5: #113
CSM 1.4: #114