Redocly / redocly-vs-code

Redocly VS Code extension
35 stars 6 forks source link

Improve the default `redocly.yaml` file #25

Closed adamaltman closed 2 years ago

adamaltman commented 2 years ago

What should we improve?

We offer a default Redocly configuration file when we detect an openapi definition.

How should we improve it?

  1. Rename it from .redocly.yaml to redocly.yaml.
  2. Replace the contents of the file with the one below, but be sure to change the path to the root file detected.
# See https://redocly.com/docs/cli/configuration/configuration-file/ for information on how to customize your configuration

apis:
  changeme@v1:
    root: ./openapi.yaml

lint:
  extends:
    - recommended
  rules:
    paths-kebab-case: error

features.openapi:
  generateCodeSamples:
    languages:
      - lang: curl
      - lang: Node.js
      - lang: Python

Why should we improve it?

The current one doesn't actually work and requires the user to make a lot of changes.

Describe alternatives you've considered

The current generated file:

apiDefinitions:
  # a set of named keys and values of entrypoints to OpenAPI definitions.
  # example
  # petstore: ./openapi.yaml

lint:
# the lint options

referenceDocs:
# the API reference docs options, including theme options.
jeremyfiel commented 2 years ago

@adamaltman will renaming the file only for vscode cause duplicate configs for a user? I use vsc and the cli depending on my workflow. I would prefer to maintain a single file. I have a separate issue opened for allowing config file location in vsc settings because it's currently tied to the workspace only. #16

adamaltman commented 2 years ago

No, it won't cause duplicate configs. It will use either redocly.yaml or .redocly.yaml. If both are present, it will throw an error. We are going to release docs about this by next week. This issue was made in advance. :smile:

adamaltman commented 2 years ago

We released the docs:

https://redocly.com/docs/api-registry/guides/migration-guide-config-file/