Skip to content

Commit

Permalink
fix(schema): update documentation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed May 8, 2024
1 parent 8636d34 commit 3239711
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/specs/schema/src/decorators/common/ignore.ts
Expand Up @@ -56,7 +56,7 @@ import {JsonEntityFn} from "./jsonEntityFn";
* @validation
* @swagger
* @schema
* @deprecated Since v7. Use @Groups decorator instead of.
* @deprecated Since v7. Use @Groups decorator instead of and enable `jsonMapper.strictGroups` in your configuration.
*/
export function Ignore(cb: boolean | IgnoreCallback = true) {
return JsonEntityFn((store) => {
Expand Down
9 changes: 4 additions & 5 deletions packages/specs/schema/src/utils/getSpecType.spec.ts
@@ -1,17 +1,16 @@
import {expect} from "chai";
import {SpecTypes} from "../domain/SpecTypes";
import {getSpecType, getSpecTypeFromSpec} from "./getSpecType";

describe("getSpecType", () => {
it("should return spect type from version", () => {
expect(getSpecType("2.0")).to.equal(SpecTypes.SWAGGER);
expect(getSpecType("3.0.1")).to.equal(SpecTypes.OPENAPI);
expect(getSpecType("2.0")).toEqual(SpecTypes.SWAGGER);
expect(getSpecType("3.0.1")).toEqual(SpecTypes.OPENAPI);
});
});

describe("getSpecTypeFromSpec", () => {
it("should return spect type from version", () => {
expect(getSpecTypeFromSpec({swagger: "2.0"})).to.equal(SpecTypes.SWAGGER);
expect(getSpecTypeFromSpec({openapi: "3.0.1"})).to.equal(SpecTypes.OPENAPI);
expect(getSpecTypeFromSpec({swagger: "2.0"})).toEqual(SpecTypes.SWAGGER);
expect(getSpecTypeFromSpec({openapi: "3.0.1"})).toEqual(SpecTypes.OPENAPI);
});
});

0 comments on commit 3239711

Please sign in to comment.