Giter Site home page Giter Site logo

Comments (8)

emckean avatar emckean commented on July 29, 2024 2

so OAI (formerly known as Swagger) looks like this:

paths:
  /user/{userId}:
    get:
      summary: Returns a user by ID.
      parameters:
        - name: userId
          in: path
          required: true
          description: Parameter description in CommonMark or HTML.
          schema:
            type : integer
            format: int64
            minimum: 1
      responses: 
        '200':
          description: OK

so you can see that you can get 'method' , 'data:params', and so on out of the OAI spec. (You can also get 'url' from a different section.)

from strest.

eykrehbein avatar eykrehbein commented on July 29, 2024

Hi @emckean. What do you exactly mean by that?

from strest.

emckean avatar emckean commented on July 29, 2024

more info here!

from strest.

lastlegion avatar lastlegion commented on July 29, 2024

In favor of using the OpenAPI spec 👍

from strest.

jgroom33 avatar jgroom33 commented on July 29, 2024

is the design goal to import from a OAI spec (i.e. create a templated strest.yml) or to use that spec in place of the existing schema?
If the goal is the latter, the OAI spec is not designed for data input so it would be best to make a suggestion on what an example would look like. like this:

paths:
  /user/{userId}:
    get:
      data:
        - userId: Env(some_env_variable)
      responses: 
        validate: '200'

^^^ doesn't make sense to me. Even if the more standard x- extension was used, it doesn't make sense use the OAI spec as a schema because the result would not conform with OAI if the strest test contains multiple calls to: GET /user/{userId}

IMO, it makes sense to have conversion.

from strest.

eykrehbein avatar eykrehbein commented on July 29, 2024

The OAI spec schema doesn't make that much sense for me neither

from strest.

jgroom33 avatar jgroom33 commented on July 29, 2024

I recommend closing this. It should be implemented as a codegen function of swagger-codegen:
https://github.com/swagger-api/swagger-codegen

from strest.

jgroom33 avatar jgroom33 commented on July 29, 2024

Maybe this could be easily modified to provide this function: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java

from strest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.