Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit c622f49

Browse files
committed
Hide scalajs depr warn. Fix examples to match amf 4.0.3 api
1 parent 39ccb86 commit c622f49

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

build.sbt

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ lazy val webapi = crossProject(JSPlatform, JVMPlatform)
7979
)
8080
.jsSettings(
8181
scalaJSModuleKind := ModuleKind.CommonJSModule,
82-
Compile / fullOptJS / artifactPath := baseDirectory.value / "target" / "artifact" / "webapi-parser-module.js"
82+
Compile / fullOptJS / artifactPath := baseDirectory.value / "target" / "artifact" / "webapi-parser-module.js",
83+
scalacOptions += "-P:scalajs:suppressExportDeprecations"
8384
)
8485

8586
lazy val webapiJVM = webapi.jvm.in(file("./jvm"))

examples/java/src/main/java/co/acme/model/Raml10Navigation.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public static void navigateApi() throws InterruptedException, ExecutionException
2929
// Access security scheme from root
3030
System.out.println(
3131
"First security scheme name: " +
32-
api.security().get(0).scheme().name().value());
32+
api.security().get(0).schemes().get(0).scheme().name().value());
3333
System.out.println(
3434
"First security scheme description: " +
35-
api.security().get(0).scheme().description().value());
35+
api.security().get(0).schemes().get(0).scheme().description().value());
3636

3737
// Endpoint /users
3838
EndPoint users = (EndPoint) api.endPoints().get(0);

examples/js/raml10-model-navigation.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ async function main () {
2323
console.log('Base uri:', api.servers[0].url.value())
2424

2525
// Access security scheme from root
26-
console.log('First security scheme name:', api.security[0].name.value())
26+
console.log(
27+
'First security scheme name:',
28+
api.security[0].schemes[0].name.value())
2729
console.log(
2830
'First security scheme description:',
29-
api.security[0].scheme.description.value())
31+
api.security[0].schemes[0].scheme.description.value())
3032

3133
// Endpoint /users
3234
const users = api.endPoints[0]

0 commit comments

Comments
 (0)