Skip to content
Draft
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
150 changes: 75 additions & 75 deletions packages/cli/src/util/__tests__/paths.spec.ts

Large diffs are not rendered by default.

82 changes: 41 additions & 41 deletions packages/http-server/src/__tests__/body-params-validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IHttpOperation } from '@stoplight/types';
import fetch, { RequestInit } from 'node-fetch';
import { createServer } from '../';
import { ThenArg } from '../types';
import * as faker from '@faker-js/faker/locale/en';
import { faker } from '@faker-js/faker';
import { Dictionary } from '@stoplight/types';
import * as FormData from 'form-data';
import { HttpParamStyles } from '@stoplight/types';
Expand Down Expand Up @@ -52,12 +52,12 @@ describe('body params validation', () => {
path: '/json-body-no-request-content-type',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -72,10 +72,10 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: '',
schema: {
type: 'object',
Expand Down Expand Up @@ -107,12 +107,12 @@ describe('body params validation', () => {
path: '/json-body-optional',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -127,11 +127,11 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
required: false,
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
type: 'object',
Expand Down Expand Up @@ -163,12 +163,12 @@ describe('body params validation', () => {
path: '/json-body-required',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -183,11 +183,11 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
required: true,
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
type: 'object',
Expand Down Expand Up @@ -223,12 +223,12 @@ describe('body params validation', () => {
path: '/json-body-property-required',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -243,10 +243,10 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
type: 'object',
Expand Down Expand Up @@ -279,12 +279,12 @@ describe('body params validation', () => {
path: '/json-body-property-required-with-custom-415',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '415',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
type: 'object',
Expand All @@ -296,7 +296,7 @@ describe('body params validation', () => {
},
examples: [
{
id: faker.random.word(),
id: faker.lorem.word(),
key: 'test',
value: { type: 'foo' },
},
Expand All @@ -309,10 +309,10 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
type: 'object',
Expand Down Expand Up @@ -345,12 +345,12 @@ describe('body params validation', () => {
path: '/json-body-circular-property-required',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -365,10 +365,10 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
$ref: '#/__bundled__/schemas',
Expand Down Expand Up @@ -410,12 +410,12 @@ describe('body params validation', () => {
path: '/empty-body',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand Down Expand Up @@ -669,12 +669,12 @@ describe('body params validation', () => {
path: '/path',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -689,10 +689,10 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/x-www-form-urlencoded',
schema: {
type: 'object',
Expand Down Expand Up @@ -727,12 +727,12 @@ describe('body params validation', () => {
path: '/application-x-www-form-urlencoded-complex-request-body',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'text/plain',
schema: {
type: 'string',
Expand All @@ -747,10 +747,10 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/x-www-form-urlencoded',
schema: {
type: 'object',
Expand Down Expand Up @@ -803,12 +803,12 @@ describe('body params validation', () => {
path: '/multipart-form-data-body-required',
responses: [
{
id: faker.random.word(),
id: faker.lorem.word(),
code: '200',
headers: [],
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'application/json',
schema: {
type: 'object',
Expand All @@ -820,7 +820,7 @@ describe('body params validation', () => {
},
examples: [
{
id: faker.random.word(),
id: faker.lorem.word(),
key: 'test',
value: { type: 'foo' },
},
Expand All @@ -833,11 +833,11 @@ describe('body params validation', () => {
servers: [],
request: {
body: {
id: faker.random.word(),
id: faker.lorem.word(),
required: true,
contents: [
{
id: faker.random.word(),
id: faker.lorem.word(),
mediaType: 'multipart/form-data',
schema: {
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion packages/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"node": ">=18.20.1"
},
"dependencies": {
"@faker-js/faker": "^6.0.0",
"@faker-js/faker": "^9.6.0",
"@stoplight/json": "3.21.7",
"@stoplight/json-schema-merge-allof": "0.7.8",
"@stoplight/json-schema-sampler": "0.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"properties": {
"name": {
"type": "string",
"x-faker": "name.firstName"
"x-faker": "person.firstName"
},
"surname": {
"type": "string",
"format": "string",
"x-faker": "name.lastName"
"x-faker": "person.lastName"
}
},
"required": ["name", "surname"]
Expand Down
Loading
Loading