openapi-generator and "ignoring complex example on request body" message - openapi

I use the org.openapi.generator gradle plugin (version 6.2.1) and when I generate spring codes from my openapi.yml file I have the follow message "Ignoring complex example on request body". I don't understand why, someone have an idea ?
Here is an exerpt of my openapi.yml file :
paths:
"/test":
post:
summary: ...
tags:
- ...
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: ...
examples:
example1:
value: [
{
...
}
]
Thanks for your help
I don't find solution

The reason is that it is not implemented/supported yet: you cannot get rid of the warning (unless suppressing WARN logging).
The code generation still works and you can use the generated spring application.

Related

When I type "npm run generate" in my code block vscode out and deleting the letter i

When I type "npm run generate" in my code block, codegen generates my graphql file automatically. But while generating vscode is freaking out and deleting the letter i. When I make a new change, I have to constantly change it. Has anyone encountered such a problem before?
My codegen.yml file looks like this:
overwrite: true
schema: "http://localhost:3000/graphql"
#schema:
# - https://***/graphql:
# headers:
# Cookie: "***"
documents: "src/**/*.graphql"
generates:
src/generated/graphql.tsx:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
- "fragment-matcher"
./graphql.schema.json:
plugins:
- "introspection"
It's probably something on your env, replacing io with O.
Could you create a minimal isolated reproduction of this issue, maybe via StackBlitz or CodeSandbox?

Why YAML Schema (from JSON Schema) is returning $ref x in schema can not be resolved?

I have this schema file in ./types/index.yaml:
$schema: "https://json-schema.org/draft/2020-12/schema"
name: Types in YAML
definitions:
flow:
type: object
properties:
slug:
type: string
flow_list:
type: 'array'
items:
$ref: "#/definitions/flow"
And I have this "instance" YAML file, in contents/en.yaml:
# yaml-language-server: $schema=../types/index.yaml#definitions/flow_list
-
slug: '123'
I would expect it to allow me to create a list of objects with the slug property on it (to get started), but instead I am getting something like this (with the ...... filled in with the full absolute OS path):
$ref 'definitions/flow_list' in 'file:///...../types/index.yaml' can not be resolved.
I am using the RedHat VSCode YAML extension. Any ideas on how to get it so I can write the array of "flows" here?
Restarting VSCode a few times seemed to fix it.

Could not locate path for parameter 'petId' warning in eclipse KaiZen Open API Editor

Eclipse Oxygen 3a with KaiZen-OpenAPI-Editor (0.8.0.201905261858) shows warning when path parameter is specified in components -> parameters.
No such warning is displayed for query parameter.
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger for pet module
paths:
/Pets/{petId}:
get:
operationId: getPet
parameters:
- $ref: "#/components/parameters/petId"
responses:
200:
description: pet response
components:
parameters:
petId:
name: petId
in: path
required: true
schema:
type: string
Following warning is displayed on line specifying name: petId:
Could not locate path for parameter 'petId'
Indeed, this is an issue with KaiZen-OpenAPI-Parser, one of the related projects. I have submitted a pull request here to fix the issue.
In the meantime, you can ignore the warning, or disable the Advanced Validation option in Preferences > KaiZen > OpenAPI v3 > Validation.

Need help to complete installation of linter-stylelint for Atom

I am really sorry for this newbie question but I can't see how solve that...
I installed linter-stylelint and tried to configure it like it's said there:
https://atom.io/packages/linter-stylelint
So:
- I placed a stylelint.config.js file in my project.
- In the settings, I checked Use standard
- But can't see what I have to do to "Add a stylelint section in your package.json"
On my Mac I see the file:
/Users/eric/node_modules/stylelint-config-standard
But I don't know what code do I have to insert inside...
By the way, when I try to use linter-stylelint in a css file I get the error message:
Unable to parse stylelint configuration
Unexpected token :
In my stylelint.config.js, I have the following code for now:
{
"extends": "stylelint-config-standard"
"rules" {
"no-unsupported-browser-features": [ true, { "severity": "warning" }]
}
}
Thanks if you can help me!
;)
Paul
So: - I placed a stylelint.config.js file in my project. - In the settings, I checked Use standard
According to the docs you reference, you should either place a stylelint.config.js file or check "Use standard".
I get the error message Unable to parse stylelint configuration Unexpected token :
This is because the JSON of your configuration file is invalid. It is missing both a comma and a colon. Use a service like JSONLint to validate JSON. Your fixed config is:
{
"extends": "stylelint-config-standard",
"rules": {
"no-unsupported-browser-features": [true, {
"severity": "warning"
}]
}
}
Even though this config is valid JSON, it won't work because the no-unsupported-browser-features rule is no longer built into stylelint. It is, however, available as a plugin. You'll need to follow the plugin's instructions if you wish to use it.
I am really sorry for this newbie question
It's fine. We are all newbies in the beginning! As you're just getting started with stylelint, I suggest you remove the stylelint.config.js file and ensure the "Use Standard" box is checked. This is likely the quickest way to get going. Once you are more comfortable with the tool, you can investigate creating your own configuration file for your specific needs.

jekyll with broken front matter, how to find the broken file?

When I make a syntax error in the front matter i'm getting the following error:
/.../psych.rb:203:in `parse': (<unknown>): could not find expected
':' while scanning a simple key at line 6 column 1
(Psych::SyntaxError)
from /.../psych.rb:203:in `parse_stream'
from /.../psych.rb:151:in `parse'
from ....
Do you know a way to tell what file caused the problem?
I know that I could probably use DTrace as follows:
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'| grep _posts
But I'm looking for something more straight forward.
it seams that jekyll does not work well on ruby 1.9.3. A more restrictive yaml parser was introduced: Psych that probably has different exception hierarchy and there for it is not properly handled by jekyll.
You may find that this is caused by faulty formatting
If your front matter looks like this:
---
menu:
- text: Home
url: /en/index.html
- text: Overview
url: /en/overview.html
---
instead of
---
menu:
- text: Home
url: /en/index.html
- text: Overview
url: /en/overview.html
---
then the YAML parser will throw it out.