Code Monkey home page Code Monkey logo

Comments (4)

x80486 avatar x80486 commented on June 11, 2024 1

Great! Now it's much better!

2022-03-21T01:57:43.635+0000|INFO|10|main|[+--------------------------+]
2022-03-21T01:57:43.636+0000|INFO|10|main|[| A P I  S i m u l a t o r |]
2022-03-21T01:57:43.636+0000|INFO|10|main|[+--------------------------+]
2022-03-21T01:57:43.639+0000|INFO|10|main|[API Simulator initialization in progress...]
2022-03-21T01:57:43.639+0000|INFO|10|main|[API Simulator: {java version:"11.0.14.1+1", jvm name:"OpenJDK 64-Bit Server VM", jvm version:"11.0.14.1+1", jvm pid:10}]
2022-03-21T01:57:43.640+0000|INFO|10|main|[API Simulator: implementation {title:"API Simulator",version:"1.10"}]
2022-03-21T01:57:43.640+0000|INFO|10|main|[API Simulator: args=[-c, /apisimulator/apisimulator-http-1.10/config, -s, /home/apisimulator/simulations/simlets, /home/apisimulator/simulations, -retain_dsl_models]]
2022-03-21T01:57:43.655+0000|INFO|10|main|[Loading configuration from '/apisimulator/apisimulator-http-1.10/config/apisim.yaml'...]
2022-03-21T01:57:43.689+0000|INFO|10|main|[Loaded admin configuration]
2022-03-21T01:57:43.693+0000|INFO|10|main|[Loaded simulator configuration]
2022-03-21T01:57:43.696+0000|INFO|10|main|[Loaded simulation configuration]
2022-03-21T01:57:43.726+0000|INFO|10|main|[Loaded 2 simlets in 71 ms]
2022-03-21T01:57:43.728+0000|INFO|10|main|[Loading simlets from '/home/apisimulator/simulations/simlets'...]
2022-03-21T01:57:44.306+0000|ERROR|10|main|[com.apisimulator.http.dsl.HttpSimletDsl.deserialize(DeserializerContext, DslConfig): java.lang.IllegalArgumentException: The URI's host shall not contain scheme or port number. host='https://api-simulator.free.beeceptor.com']
Exception in thread "main" 2022-03-21T01:57:44.306+0000|INFO|10|main|[Loaded 1 simlet in 578 ms]
java.lang.IllegalArgumentException: The URI's host shall not contain scheme or port number. host='https://api-simulator.free.beeceptor.com'
	at com.apisimulator.http.dsl.callback.HttpCallbackDsl.deserialize(Unknown Source)
	at com.apisimulator.http.dsl.callback.Http1CallbackDsl.deserialize(Unknown Source)
	at com.apisimulator.http.dsl.callback.HttpCallbackDispatcher.deserialize(Unknown Source)
	at com.apisimulator.http.dsl.response.HttpResponseDsl.processResponseConfig(Unknown Source)
	at com.apisimulator.http.dsl.response.HttpResponseDsl.processAllResponsesConfig(Unknown Source)
	at com.apisimulator.http.dsl.response.HttpResponseDsl.deserialize(Unknown Source)
	at com.apisimulator.dsl.ConfigurableDslDeserializer.driveMapDeserialization(Unknown Source)
	at com.apisimulator.dsl.ConfigurableDslDeserializer.processObject(Unknown Source)
	at com.apisimulator.dsl.ConfigurableDslDeserializer.deserialize(Unknown Source)
	at com.apisimulator.http.dsl.HttpSimletDsl.deserialize(Unknown Source)
	at com.apisimulator.config.HttpSimletDslMapDeserializer.doDeserialize(Unknown Source)
	at com.apisimulator.dsl.DslConfigMapDeserializerBase.deserialize(Unknown Source)
	at com.apisimulator.http.dsl.HttpSimletDslConfigLoaderBase.loadFromStream(Unknown Source)
	at com.apisimulator.http.dsl.HttpSimletDslConfigLoaderBase.loadFromFile(Unknown Source)
	at com.apisimulator.config.HttpSimletPerFileLoader$1.process(Unknown Source)
	at com.apisimulator.io.DirectoryTreeWalker.walk(Unknown Source)
	at com.apisimulator.io.DirectoryTreeWalker.walk(Unknown Source)
	at com.apisimulator.io.DirectoryTreeWalker.walk(Unknown Source)
	at com.apisimulator.io.DirectoryTreeWalker.walk(Unknown Source)
	at com.apisimulator.io.DirectoryTreeWalker.walkTree(Unknown Source)
	at com.apisimulator.config.HttpSimletPerFileLoader.loadFromDir(Unknown Source)
	at com.apisimulator.HttpAPISimulatorInit.initSimulation(Unknown Source)
	at com.apisimulator.APISimulator.doInit(Unknown Source)
	at com.apisimulator.launcher.AbstractLaunchable.init(Unknown Source)
	at com.apisimulator.launcher.AbstractLaunchable.launch(Unknown Source)
	at com.apisimulator.APISimulator.main(Unknown Source)

from apisimulator.

x80486 avatar x80486 commented on June 11, 2024

OK, it works if https:// is removed from response.callback.http1.uri.host 😅

Not sure if this is something you might want to explicitly state in the documentation, accept the protocol as part of the hostname, or fail the simlet when it loads because of that 🤔

from apisimulator.

apisim avatar apisim commented on June 11, 2024

The documentation for host states that "Host can be a DNS name or an IP address".

It may be hard to predict all possible misconfigurations (e.g. appending a port number as well)...but I can understand how some checks can improve the experience by failing with a descriptive message at startup-time instead of run-time.

from apisimulator.

apisim avatar apisim commented on June 11, 2024

This enhancement was included in the just released v1.10.

Give it a try when you get a chance, @x80486.
Thanks!

from apisimulator.

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.