Skip to content

Commit

Permalink
Merge branch 'main' into chore/v1.0.0-beta.125
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorKarpiuk committed Apr 6, 2023
2 parents 661b377 + 013e52e commit b8cc1be
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apis:
main:
root: ./openapi.yaml
rules:
required-string-property-missing-min-length: error
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`E2E lint required-min-length-string-type-property 1`] = `
exports[`E2E lint required-string-property-missing-min-length 1`] = `
validating /openapi.yaml...
[1] openapi.yaml:37:19 at #/paths/~1pet~1findByStatus/get/responses/200/content/application~1json/schema/properties/a
Expand All @@ -14,7 +14,7 @@ Property minLength is required.
38 | type: string
39 |
Error was generated by the required-min-length-string-type-property rule.
Error was generated by the required-string-property-missing-min-length rule.
[2] openapi.yaml:50:23 at #/paths/~1pet~1findByStatus/get/responses/200/content/application~1json/schema/properties/c/properties/d
Expand All @@ -28,7 +28,7 @@ Property minLength is required.
51 | type: string
52 |
Error was generated by the required-min-length-string-type-property rule.
Error was generated by the required-string-property-missing-min-length rule.
/openapi.yaml: validated in <test>ms
Expand Down
30 changes: 15 additions & 15 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,30 +166,30 @@ bundled.yaml: split processed in 76ms
So, what just happened? Take a look in the newly created `bundled` directory. That's where the magic is! See how the `split` command automatically broke the single API definition into its constituent parts and very kindly organized them in the new directory?

```bash
.
├── code samples
── C#
└── postundefined
── C#
| └── postundefined
│ └── PHP
│ └── postundefined
├── components
── headers
└── ExpiresAfter.yaml
── responses
└── Problem.yaml
── headers
| └── ExpiresAfter.yaml
── responses
| └── Problem.yaml
│ └── schemas
── Email.yaml
── Problem.yaml
── Schema.yaml
── Email.yaml
── Problem.yaml
── Schema.yaml
│ └── User.yaml
├── paths
── echo.yaml
── pathItem.yaml
── pathItemWithExamples.yaml
└── users@{username}.yaml
── echo.yaml
── pathItem.yaml
── pathItemWithExamples.yaml
│ └── users@{username}.yaml
└── openapi.yaml
```


:::info Note

`openapi.yaml` in the `bundled` folder is the default name that Redocly CLI gives to the 'root' YAML file you just split up. It contains `$ref`s to its constituent parts. You do the work in the constituent parts.
Expand All @@ -207,7 +207,7 @@ $ redocly bundle openapi.yaml --output bundled.yaml

Use `preview-docs` to generate a preview of your API reference docs.

First of all, make sure you have a bundled file to preview. Then in your terminal, type the following:
First, make sure you have a definition file to preview. Then in your terminal, enter the following command, replacing `bundled.yaml` with the file path and name of your definition file:

```bash
$ redocly preview-docs bundled.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Oas3Schema, Oas3_1Schema } from '../../typings/openapi';
import { Oas2Schema } from 'core/src/typings/swagger';
import { Oas3Rule } from 'core/src/visitors';

export const RequiredMinLengthStringTypeProperty: Oas3Rule = () => {
export const RequiredStringPropertyMissingMunLength: Oas3Rule = () => {
let skipSchemaProperties: boolean;
let requiredPropertiesSet: Set<string>;

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/rules/oas2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { PathSegmentPlural } from '../common/path-segment-plural';
import { ResponseContainsHeader } from '../common/response-contains-header';
import { ResponseContainsProperty } from './response-contains-property';
import { ScalarPropertyMissingExample } from '../common/scalar-property-missing-example';
import { RequiredMinLengthStringTypeProperty } from '../common/required-min-length-string-type-property';
import { RequiredStringPropertyMissingMunLength } from '../common/required-string-property-missing-min-length';

export const rules = {
spec: OasSpec as Oas2Rule,
Expand Down Expand Up @@ -83,7 +83,7 @@ export const rules = {
'response-contains-header': ResponseContainsHeader as Oas2Rule,
'response-contains-property': ResponseContainsProperty as Oas2Rule,
'scalar-property-missing-example': ScalarPropertyMissingExample,
'required-min-length-string-type-property': RequiredMinLengthStringTypeProperty,
'required-string-property-missing-min-length': RequiredStringPropertyMissingMunLength,
};

export const preprocessors = {};
4 changes: 2 additions & 2 deletions packages/core/src/rules/oas3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { ResponseContainsProperty } from './response-contains-property';
import { ScalarPropertyMissingExample } from '../common/scalar-property-missing-example';
import { SpecComponentsInvalidMapName } from './spec-components-invalid-map-name';
import { Operation4xxProblemDetailsRfc7807 } from './operation-4xx-problem-details-rfc7807';
import { RequiredMinLengthStringTypeProperty } from '../common/required-min-length-string-type-property';
import { RequiredStringPropertyMissingMunLength } from '../common/required-string-property-missing-min-length';

export const rules = {
spec: OasSpec,
Expand Down Expand Up @@ -103,7 +103,7 @@ export const rules = {
'response-contains-property': ResponseContainsProperty,
'scalar-property-missing-example': ScalarPropertyMissingExample,
'spec-components-invalid-map-name': SpecComponentsInvalidMapName,
'required-min-length-string-type-property': RequiredMinLengthStringTypeProperty,
'required-string-property-missing-min-length': RequiredStringPropertyMissingMunLength,
} as Oas3RuleSet;

export const preprocessors = {};
2 changes: 1 addition & 1 deletion packages/core/src/types/redocly-yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const builtInRulesList = [
'response-contains-property',
'scalar-property-missing-example',
'spec-components-invalid-map-name',
'required-min-length-string-type-property',
'required-string-property-missing-min-length',
];
const nodeTypesList = [
'any',
Expand Down

0 comments on commit b8cc1be

Please sign in to comment.