Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Response ERROR Not Found #205

Open
bruceforlearn opened this issue Sep 15, 2017 · 6 comments
Open

API Response ERROR Not Found #205

bruceforlearn opened this issue Sep 15, 2017 · 6 comments

Comments

@bruceforlearn
Copy link

Hello sir @fehguy

after you help, I could run server normally

and I run a test API successfully, but 404 error happened

I have check web.xml where not a webapp project

I don't know how to solve, please help

thank you

[root@picnicv3 swagger]# ls
editor editor.sh inflector.yaml pom.xml src
[root@picnicv3 swagger]# ./editor.sh
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building swagger-editor 1.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.2.9.v20150224:run-war (default-cli) > package @ swagger-editor >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ swagger-editor ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/swagger/editor/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ swagger-editor ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ swagger-editor ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/swagger/editor/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ swagger-editor ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ swagger-editor ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ swagger-editor ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO]
[INFO] <<< jetty-maven-plugin:9.2.9.v20150224:run-war (default-cli) < package @ swagger-editor <<<
[INFO]
[INFO] --- jetty-maven-plugin:9.2.9.v20150224:run-war (default-cli) @ swagger-editor ---
[INFO] Logging initialized @2231ms
[INFO] Configuring Jetty for project: swagger-editor
[INFO] Context path = /
[INFO] Tmp directory = /home/swagger/editor/target/tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] jetty-9.2.9.v20150224
[INFO] Started o.e.j.m.p.JettyWebAppContext@50a3d0f6{/,file:/home/swagger/editor/target/tmp/webapp/,AVAILABLE}{/home/swagger/editor/swagger-editor.war}
[WARNING] !RequestLog
[INFO] Started ServerConnector@5f245754{HTTP/1.1}{0.0.0.0:8000}
[INFO] Started @2872ms
[INFO] Started Jetty Server

123

@bruceforlearn
Copy link
Author

[INFO] io.swagger:my-project:jar:1.0.1
[INFO] - io.swagger:swagger-inflector:jar:1.0.9:compile
[INFO] +- io.swagger:swagger-jersey2-jaxrs:jar:1.5.10:compile
[INFO] | - io.swagger:swagger-jaxrs:jar:1.5.10:compile
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.4.5:compile
[INFO] | | - org.yaml:snakeyaml:jar:1.12:compile
[INFO] | +- org.reflections:reflections:jar:0.9.10:compile
[INFO] | | - com.google.code.findbugs:annotations:jar:2.0.1:compile
[INFO] | +- com.google.guava:guava:jar:18.0:compile
[INFO] | - com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.4.5:compile
[INFO] +- io.swagger:swagger-parser:jar:1.0.22:compile
[INFO] | - io.swagger:swagger-core:jar:1.5.8:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.5:compile
[INFO] | +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.4.5:compile
[INFO] | +- io.swagger:swagger-models:jar:1.5.8:compile
[INFO] | | - io.swagger:swagger-annotations:jar:1.5.8:compile
[INFO] | - javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.6:compile
[INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.2.0:compile
[INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.6:compile
[INFO] | | - javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.6:compile
[INFO] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.6:compile
[INFO] | | - org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | - javax.ws.rs:javax.ws.rs-api:jar:2.0:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-multipart:jar:2.6:compile
[INFO] | - org.jvnet.mimepull:mimepull:jar:1.9.3:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.6:compile
[INFO] | +- org.glassfish.hk2:hk2-api:jar:2.2.0:compile
[INFO] | | +- org.glassfish.hk2:hk2-utils:jar:2.2.0:compile
[INFO] | | - org.glassfish.hk2.external:aopalliance-repackaged:jar:2.2.0:compile
[INFO] | - org.glassfish.hk2:hk2-locator:jar:2.2.0:compile
[INFO] | - org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.1:compile
[INFO] +- ch.qos.logback:logback-core:jar:1.0.1:compile
[INFO] +- org.slf4j:slf4j-ext:jar:1.6.3:compile
[INFO] | - ch.qos.cal10n:cal10n-api:jar:0.7.4:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.3:compile
[INFO] +- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- org.apache.commons:commons-csv:jar:1.1:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.4.6:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.4.6:compile
[INFO] | - com.fasterxml.jackson.core:jackson-databind:jar:2.4.6:compile
[INFO] +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-xml-provider:jar:2.4.6:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.4.6:compile
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.4.6:compile
[INFO] | +- org.codehaus.woodstox:stax2-api:jar:3.1.1:compile
[INFO] | | - javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | - org.codehaus.woodstox:woodstox-core-asl:jar:4.4.0:compile
[INFO] +- com.github.fge:json-schema-validator:jar:2.2.6:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] | +- joda-time:joda-time:jar:2.3:compile
[INFO] | +- com.googlecode.libphonenumber:libphonenumber:jar:6.2:compile
[INFO] | +- com.github.fge:json-schema-core:jar:1.2.5:compile
[INFO] | | +- com.github.fge:uri-template:jar:0.9:compile
[INFO] | | | - com.github.fge:msg-simple:jar:1.1:compile
[INFO] | | | - com.github.fge:btf:jar:1.2:compile
[INFO] | | +- com.github.fge:jackson-coreutils:jar:1.8:compile
[INFO] | | - org.mozilla:rhino:jar:1.7R4:compile
[INFO] | +- javax.mail:mailapi:jar:1.4.3:compile
[INFO] | | - javax.activation:activation:jar:1.1:compile
[INFO] | - net.sf.jopt-simple:jopt-simple:jar:4.6:compile
[INFO] - commons-fileupload:commons-fileupload:jar:1.3.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

@bruceforlearn
Copy link
Author

I have config a API on swagger editor.

Is this API service working automation?
or I need download the API server code (just like spring) and deploy in other Jboss server
thank you
@fehguy

@fehguy
Copy link
Contributor

fehguy commented Sep 15, 2017

It really depends. Did you follow the readme in this project or do something else?

@bruceforlearn
Copy link
Author

@fehguy Hello Sir

I only run three commands, after I yum install maven

  1. curl -L http://bit.ly/1Pl62pe | project=my-project bash
  2. add code to web.xml
  3. ./editor.sh
    and then I write a API demo on swagger editor
    but it didn't works

@bruceforlearn
Copy link
Author

swagger: "2.0"
info:
version: 1.0.0
title: title
description: description
termsOfService: terms
host: localhost:8090
paths:
/Assurance/v1/Place/20416436103/Customer/1-7MWK-3013/Devices/:
get:
produces:
- application/json
responses:
'200':
description: Ok
schema:
type: array
items:
$ref: '#/definitions/DeviceArray'
/assurance/v1/Customer123/places:
get:
produces:
- application/json
responses:
'200':
description: Ok
schema:
type: array
items:
$ref: '#/definitions/TAMplaces'
/Assurance/v1/Devices/165002320102:
get:
produces:
- application/json
responses:
'200':
description: Ok
schema:
type: array
items:
$ref: '#/definitions/DeviceDetails'
/assurance/v1/Ports/PortID123/rfs:
get:
produces:
- application/json
responses:
'200':
description: Ok
schema:
type: array
items:
$ref: '#/definitions/PortDetailsRFS'

/fileUpload:
post:
x-swagger-router-controller: TestController
operationId: uploadFile
consumes:
- application/x-www-form-urlencoded
parameters:
- in: formData
name: theFile
type: string
- in: formData
name: stringMetadata
type: string
- in: formData
name: intMetadata
type: integer
format: int32
responses:
200:
description: the stringMetadata passed in
schema:
type: string
definitions:
DeviceArray:
type: array
x-swagger-router-model: io.swagger.test.models.DeviceArray
items:
type: object
properties:
DebiceID:
type: string
NetworkName:
type: string
RelativeName:
type: string
Type:
type: string
example:
- DeviceID: 105621398103
NetworkName: nzp-20007-gnd-as-01
RelativeName: NZP-20007-GND-AS-01.PST.SYTECNMS.NET
Type: null
- DeviceID: 1036091311033
NetworkName: nzp-20007-gnd-rt-01
RelativeName: nzp-20007-gnd-RT-01
Type: NTU
- DeviceID: 122403148102
NetworkName: null
RelativeName: BEAS/U_NTU_001
Type: null
- DeviceID: 165002297102
NetworkName: null
RelativeName: BEAS/G_HSNS SDP_001
Type: Alcatel MSAP
- DeviceID: 165002320102
NetworkName: 10.6.194.126
RelativeName: BEAS/G_ONEA1424X_001
Type: OneAccess IAD/Router
- DeviceID: 160885080102
NetworkName: null
RelativeName: BEAS/U_CISCO_1921_001
Type: Cisco Packet Switch
TAMplaces:
type: object
x-swagger-router-model: io.swagger.test.models.TAMplace
required:
- placeId
properties:
placeId:
type: integer
name:
type: string
relativeName:
type: string
fullName:
type: string
alias1:
type: string
alias2:
type: string
description:
type: string
address:
type: string
address1:
type: string
address2:
type: string
address3:
type: string
xcoordinate:
type: string
ycoordinate:
type: string
geographicType:
type: string
geographicgridType:
type: string
geographicZcoord:
type: string
geographicLocationId:
type: string
localAddress:
type: string
localAddress1:
type: string
localAddress2:
type: string
localAddress3:
type: string
townCity:
type: string
localDescription:
type: string
placeType:
type: string
example: Customer Site
sourceSys:
type: integer
example: 101
DeviceDetails:
type: object
x-swagger-router-model: io.swagger.test.models.DeviceDetails
required:
- DeviceID
properties:
DeviceID:
type: integer
example: 165002320102
name:
type: string
example: BEAS/G_ONEA1424X_001
networkName:
type: string
description:
type: string
type:
type: string
subType:
type: string
location:
type: integer
Ports:
items:
properties:
portId:
type: integer
example: 165002321102
name:
type: string
example: DSL-LINE
relativename:
type: string
RFS:
items:
properties:
circuitid:
type: integer
name:
type: string
designation:
type: string
example: SHA0002665
a-deviceid:
type: integer
example: 146308807102
a-portid:
type: integer
example: 153079974102
z-deviceid:
type: integer
z-portid:
type: integer
description:
type: string
Numbers:
items:
properties:
Name:
type: integer
Value:
type: string
type: object
type: array
type: object
type: array
type: object
type: array
PortDetailsRFS:
type: object
x-swagger-router-model: io.swagger.test.models.PortDetailsRFS
required:
- deviceid
properties:
deviceid:
type: integer
name:
type: string
networkName:
type: string
description:
type: string
type:
type: string
subType:
type: string
location:
type: integer
Ports:
items:
properties:
portId:
type: integer
name:
type: string
relativename:
type: string
RFS:
items:
properties:
circuitid:
type: integer
name:
type: string
designation:
type: string
a-deviceid:
type: integer
a-portid:
type: integer
z-deviceid:
type: integer
z-portid:
type: integer
description:
type: string
Numbers:
items:
properties:
Name:
type: integer
Value:
type: string
type: object
type: array
type: object
type: array
Numbers:
items:
properties:
Name:
type: integer
Value:
type: string
type: object
type: array
type: object
type: array

@bruceforlearn
Copy link
Author

Hello @fehguy

I write a API and download it as nodejs from inflector

but it response
[
""
]
what happened?
is it a issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants