Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

----
## [Unreleased]
### Added

* `newMethod()` now includes a `deprecated` flag on the operation template, defaulting to `false`, so generated operation objects declare the standard OpenAPI `deprecated` field.

## [3.0.0] => 2024-MAY-30
### Fixed
Expand Down
1 change: 1 addition & 0 deletions models/OpenAPI/Util.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ component name="OpenAPIUtil" accessors="true" {
{ "tags" : [] },
{ "description" : "" },
{ "operationId" : "" },
{ "deprecated" : false },
{ "parameters" : [] },
{ "responses" : { "default" : descMap } }
];
Expand Down
10 changes: 10 additions & 0 deletions test-harness/tests/specs/DocumentSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ component extends="tests.resources.BaseOpenAPISpec" {
} );
} );

describe( "Operation template tests", function(){
it( "Tests that newMethod() includes a deprecated flag defaulting to false", function(){
var method = getInstance( "OpenAPIUtil@SwaggerSDK" ).newMethod();

expect( method ).toBeStruct().toHaveKey( "deprecated" );
expect( method[ "deprecated" ] ).toBeBoolean();
expect( method[ "deprecated" ] ).toBeFalse();
} );
} );

describe( "Core functionality tests", function(){
it( "Tests that an attempt to locate an invalid path with return a $ref object", function(){
var DocumentObject = getInstance( "OpenAPIDocument@SwaggerSDK" ).init( VARIABLES.testDocument );
Expand Down