Replies: 1 comment 3 replies
-
Implementation IdeaThis feature could be implemented by enhancing the importer logic to automatically create a templated JSON Request/Response pair using Microcks EL. When parsing a specification, if no explicit examples are defined for an operation, Microcks could extract the JSON Schema of a successful response (e.g., status codes 200, 201, …) and generate a virtual default example. This generated example would be derived from the schema itself and expressed in Microcks EL, serving as a fallback when no user-provided examples are available. for example:
Microcks would add an example with the following template
Evaluated template:
This will require an upgrade of the EL system to add more functions |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, generating example responses in Microcks requires specifying a template with explicit tags(https://microcks.io/documentation/references/templates/#first-name-generator).
I think that it would be useful to implement an option in Microcks to infer example responses directly from a schema without requiring templates with explicit tags.
For example, given this schema:
Microcks could automatically generate an example response like:
Tools like [JSON Schema Faker](https://json-schema-faker.js.org/) already demonstrate automatic example generation from schemas.

related Issues: #1658
Beta Was this translation helpful? Give feedback.
All reactions