swagger-api / swagger-api/swagger-codegen

[JAVA] Unable to access generated API threw HTTP, help needed!

Open
#9,042 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Using RESTEasy export from SwaggerHub of my OpenAPI 3.0 project, I can't access to the API ressources threw HTTP after running the application.

Swagger-codegen version

SwaggerHub codegen current version

Swagger declaration
openapi: 3.0.0
servers:
# Added by API Auto Mocking Plugin
  - description: SwaggerHub API Auto Mocking
    url: http://localhost:8080
info:
  description: This is a TTS & STT API
  version: "1.0.0"
  title: Simple TTS & STT API
  contact:
    email: support@company.com
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
  - name: admins
    description: Secured Admin-only calls
  - name: developers
    description: Operations available to regular developers
paths:
  /TextToSpeech:
    get:
      summary: text to speech
      operationId: TextToSpeech
      description: text to speech
      parameters:
        - in: query
          name: inputText
          description: text to analyze
          required: true
          schema:
            type: string
        - in: query
          name: lang
          description: origin langage
          required: true
          schema:
            type: string
      responses:
        '200':
          description: returned speech
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Speech'
        '400':
          description: bad input parameter
  /SpeechToText:
    post:
      summary: speech to text
      operationId: SpeechToText
      description: speech to text
      responses:
        '201':
          description: returned text
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Text'
        '400':
          description: 'invalid input, object invalid'
      requestBody:
        content:
          application/octet-stream:
            schema:
              $ref: '#/components/schemas/Speech'
        description: original speech
components:
  schemas:
    Speech:
      type: string
      format: binary
    Text:
      required:
        - name
      properties:
        inputText:
          type: string
          example: can you help me with my last order?
        lang:
          type: string
          example: 'en-US'
      type: object
Steps to reproduce
  • Export
  • Unzip
  • Open project with Netbeans
  • Build with dependencies
  • Run (using Apache Tomcat 8.5.15)
  • Access http://localhost:8080/TextToSpeech
  • 404

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the SwaggerHub RESTEasy export using the supplied OpenAPI paths, then run the generated project on Apache Tomcat 8.5.15 and inspect the deployment and server logs. Verify the deployed context and the /TextToSpeech URL against the generated API mapping; done means the documented request no longer returns 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.