<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: JerDox</title>
    <description>The latest articles on DEV Community by JerDox (@jerdox).</description>
    <link>https://dev.to/jerdox</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F879947%2F3662a5ad-7931-4f2a-acb9-d27f6b4f1681.jpg</url>
      <title>DEV Community: JerDox</title>
      <link>https://dev.to/jerdox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jerdox"/>
    <language>en</language>
    <item>
      <title>Create a Websocket client in Javascript using a web worker</title>
      <dc:creator>JerDox</dc:creator>
      <pubDate>Tue, 22 Apr 2025 08:55:22 +0000</pubDate>
      <link>https://dev.to/jerdox/create-a-websocket-client-in-javascript-using-a-web-worker-19cb</link>
      <guid>https://dev.to/jerdox/create-a-websocket-client-in-javascript-using-a-web-worker-19cb</guid>
      <description>&lt;p&gt;This is a short tutorial on how to create a JavaScript WebSocket client that runs in a Web Worker.&lt;/p&gt;

&lt;p&gt;The finished files can be downloaded at: &lt;a href="https://github.com/peronX/WebsocketClinetInWebWorker" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;The goal is to exchange data between a WebSocket server and the web client in real time. I decided to use a Web Worker to outsource the handling of the WebSocket data flow from the main thread, &lt;br&gt;
to reducing the communication load.&lt;br&gt;
I also implemented a reconnection logic, since the connection could not be establish or was closed unexpectedly&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We will create two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;index.html&lt;/strong&gt;: &lt;em&gt;contains the load of the web worker and processing datas from the WebSocket connection&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;websocketHandler.worker.js&lt;/strong&gt;: &lt;em&gt;The web worker file, handling of the WebSocket connection and datas&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Short infos to Web workers
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A web worker...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;runs in a separate thread, independent from your web browser's main thread&lt;/li&gt;
&lt;li&gt;cannot access or manipulate the DOM&lt;/li&gt;
&lt;li&gt;communicates with the main thread using messages via "postMessage"&lt;/li&gt;
&lt;li&gt;runs in a separate .js file&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Creating the Websocket client
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Let's start by creating a JavaScript file named &lt;strong&gt;websocketHandler.worker.js&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;At the top, we’ll add some variables that we’ll use later
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let socket = null; // contains the socket object
let shouldReconnect = true; // a flag when we want to auto reconnect
let reconnectTimeout = null; // contains the reconnect timer
let wsServerUrl = '' // the URL to our WebSocket server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Next we add a "onmessage" event function for handling incoming messages to the web worker.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onmessage = function (e) {   
    const data = e.data;
    handlingWebSocket(data);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will be triggered when a message sent to the web worker. The format for this messages will be: &lt;code&gt;wsWorker.postMessage({ type: '&amp;lt;will be connect, send or disconnect&amp;gt;', payload: '&amp;lt;datas of the message&amp;gt;' });&lt;/code&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create also a function &lt;strong&gt;handlingWebSocket(data);&lt;/strong&gt; for processing the WebSocket interface
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handlingWebSocket(data) {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Now in this function, we create a handling of the different incoming messages-types (connect, send, disconnect). For this create a switch-case for the different message-types:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; switch (data.type) {
    case 'connect':
        // Logic to open the connection to the websocket server
        break;

    case 'send':
        // sending a message to the web socket server
        break;

    case 'disconnect':
        // disconnet and do some clean up
        break;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's fill the different cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Case: connect&lt;/strong&gt; - Connect to the Websocket server. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When message of type "connect" &lt;code&gt;wsWorker.postMessage({ type: 'connect', wsServerUrl: 'ws://192.168.100.150:4040' });&lt;/code&gt; is coming to the web worker,&lt;br&gt;
we check if still a connection is open, clean the socket object for safty and then call a seperated &lt;strong&gt;connectToWebsocket&lt;/strong&gt; function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case 'connect':
    // save URL in local variable
    wsServerUrl = data.wsServerUrl

    // set auto reconnect, so when a connection could not be established it will try to reconnect again
    shouldReconnect = true

    // be sure that there is not still a WebSocket server object
    if (socket &amp;amp;&amp;amp; socket.readyState !== WebSocket.CLOSED &amp;amp;&amp;amp; socket.readyState !== WebSocket.CLOSING) {
        return;
    }

    // to be save the object is empty
    socket = null;

    // call the function to open the connection
    connectToWebSocket(wsServerUrl);
    break;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we create and fill the &lt;strong&gt;connectToWebsocket&lt;/strong&gt; function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function connectToWebSocket(wsServerUrl) {
    console.dir("Start connection to WebsocketServer...");

    // open the connection to the WebSocket server
    socket = new WebSocket(wsServerUrl);

    // event which triggered when the connection has been established
    socket.onopen = () =&amp;gt; {
        // clear the timeout when the connection was established
        clearTimeout(reconnectTimeout);

        // send message to parent function that the connection was established
        postMessage({ type: 'connected' });
    };

    // event when a message comes from the WebSocket server
    socket.onmessage = (event) =&amp;gt; {
        try {
            const msgContent = JSON.parse(event.data);
            postMessage({ type: 'data', payload: msgContent });
        } catch (err) {
            postMessage({ type: 'error', payload: "Error at parsing message datas" });
        }
    };

    // event will be triggered when an error with the WebSocket interfaces raised
    socket.onerror = (err) =&amp;gt; {
        postMessage({ type: 'error', payload: err.message });
    };

    // event which triggered when the connection to the WebSocket server will be closed
    socket.onclose = () =&amp;gt; {
        postMessage({ type: 'closed' });

        // clean up before try to reconnect
        disposeWebSocket()   

        // check if reconnection should be running
        if (shouldReconnect) {
            postMessage({ type: 'reconnect' });

            // set a timeout every 5sec for trying to reconnect
            reconnectTimeout = setTimeout(
            () =&amp;gt; connectToWebSocket(wsServerUrl),
                5000);
        }     
    };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We also have to create a dispose function "disposeWebSocket()" to do a clean up
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function disposeWebSocket() {
    clearTimeout(reconnectTimeout);

    if (socket) {
        socket.onopen = null;
        socket.onmessage = null;
        socket.onerror = null;
        socket.onclose = null;

        socket = null;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Case: send&lt;/strong&gt; - Next we fill the case for sending datas to the WebSocket sever.
We check if the connection is still open before we send datas.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case 'send':
    // check if the connection still open before sending datas
    if (socket &amp;amp;&amp;amp; socket.readyState === WebSocket.OPEN) {
        socket.send(JSON.stringify(data.payload));
    }
    break;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Case: disconnect&lt;/strong&gt; - Finally we create the case for disconnecting from the WebSocket server. We call this when we leave the page or the communication should be ending.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case 'disconnect':
    // prevent auto reconnect when the connection was active closed
    shouldReconnect = false

    if (socket) {
        // we call the close method and pass a status code.
        // code 1000 means normal closure
        socket.close(1000, "Client closing connection");
        console.dir("Sent CLOSE-connection request to server");
    }

    // call the dispose function to clean up
    disposeWebSocket();

    // set the command to end up the web worker semselfe
    self.close();

    break;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  As next we'll create the logic for using our WebSocket web worker
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First create the &lt;strong&gt;index.html&lt;/strong&gt; file with a default base structure like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;title&amp;gt;WebSocket Worker Demo&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h2&amp;gt;WebSocket Worker&amp;lt;/h2&amp;gt;
    &amp;lt;div id="status"&amp;gt;Connecting...&amp;lt;/div&amp;gt;

    &amp;lt;!-- Button for sending datas to the websocket server --&amp;gt;
    &amp;lt;button onclick="sendDatasToWss()"&amp;gt;send datas to WSS&amp;lt;/button&amp;gt;

    &amp;lt;script&amp;gt;
        // here we palce the logig for the websocket interface
    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Inside the "srcipt" tag we start with create the web worker object
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const wsWorker = new Worker('websocketHandler.worker.js');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We use the object and send a postMessage of type: "connect" to call the web worker to connect to the WebSocket server like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wsWorker.postMessage({ type: 'connect', wsServerUrl: 'ws://192.168.100.150:4040' });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then we add a handling for messages from the web worker
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wsWorker.onmessage = (event) =&amp;gt; {
    const { type, payload } = event.data;
    const statusEl = document.getElementById('status');

    if (type === 'connected') {
        statusEl.textContent = "#### CONNECTION to WebSocketServer ESTABLISHED ####";
    } else if (type === 'data') {
        console.dir('Data incomming: ' + JSON.stringify(payload));
    } else if (type === 'error') {
        statusEl.textContent = "Error: " + JSON.stringify(payload);
    } else if (type === 'closed') {
        statusEl.textContent = "WebSocket is closed";
    }else if (type === 'reconnect'){
        statusEl.textContent = "Connection to WebSocketServer closed - Try to reconnect...";
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We also add a function to test the sending of datas to the websocket server
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sendDatasToWss(){
    console.log("Sending datas to WSS");
    wsWorker.postMessage({ type: 'send', msgContent: 'SomeDatas you need in the WSS' });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Do a clean up when the page will be leave
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.addEventListener('beforeunload', () =&amp;gt; {
    wsWorker.postMessage({ type: 'disconnect' });

    // Give the worker time to clean up before terminate the web worker
    setTimeout(
        () =&amp;gt; wsWorker.terminate(),
    10);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we now open the &lt;strong&gt;index.html&lt;/strong&gt; file and the WebSocket connection should be established.&lt;br&gt;&lt;br&gt;
We see what's happening in the &lt;code&gt;&amp;lt;div id="status"&amp;gt;Connecting...&amp;lt;/div&amp;gt;&lt;/code&gt; on the page.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>websocket</category>
      <category>webworker</category>
    </item>
    <item>
      <title>Symfony - Webpage drops error after installing API-Platfrom</title>
      <dc:creator>JerDox</dc:creator>
      <pubDate>Tue, 21 Jun 2022 16:05:54 +0000</pubDate>
      <link>https://dev.to/jerdox/symfony-webpage-drops-error-after-installing-api-platfrom-2o78</link>
      <guid>https://dev.to/jerdox/symfony-webpage-drops-error-after-installing-api-platfrom-2o78</guid>
      <description>&lt;p&gt;After I made it to install the &lt;a href="https://dev.to/jerdox/symfony-42-installing-api-platfrom-for-using-web-services-3fd7"&gt;API-Platform&lt;/a&gt; and &lt;a href="https://dev.to/jerdox/symfony-42-creating-an-entity-with-the-maker-bundle-and-migrate-it-30co"&gt;create an entity with the maker-bundle&lt;/a&gt; and also &lt;a href="https://dev.to/jerdox/updating-symfony-42-to-44-i48"&gt;updated Symfony&lt;/a&gt; to version 4.4, I get an error when I open my webpage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2fsm7x81ynp1ep5h6o9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2fsm7x81ynp1ep5h6o9.png" alt="Image of the 500 error message from the webbrowser"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And although that I activate the debugging mode, I don't get a proper error message, that's sucks....&lt;/p&gt;

&lt;p&gt;In the passt I often getting a more detailed error message when by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php bin/console clear:cache&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;...and yes this time too. The error message said:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In FileLoader.php line 180: 

  There is no builtin action for the collection GET operation. You need to define the controller yourself in . (which is being imported from "&amp;lt;path&amp;gt;\config/routes/api_platform.yaml"). Make sure there is a loader supporting the "api_platform" type.  

In ApiLoader.php line 177:

  There is no builtin action for the collection GET operation. You need to define the controller yourself.  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I don't know where the problem comes from and this time googleing gets also no helpful links... &lt;/p&gt;

&lt;p&gt;So and now ???&lt;/p&gt;

&lt;p&gt;I remember that I have updating Symfony the dependencies to the Symfony version 4.4. But the api-platform/core was not updated to a new version, it was still on version "2.1" &lt;/p&gt;

&lt;p&gt;So I decide to update this and all the other dependencies.&lt;/p&gt;

&lt;p&gt;There for in my composer.json I changed the version of the api-platform/core from "2.1" to "&lt;strong&gt;^&lt;/strong&gt;2.1" to let composer decide which version should be installed.&lt;/p&gt;

&lt;p&gt;I save the file and run the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer update --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;As it runs it ends up with an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Could not delete C:\Users\userap\Desktop\_Workspace\WebDevelopment\WebClient_2\dosierung\vendor/sensio/framework-extra-bundle\Resources\config:   
  This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay the last sentence sounds plausible to me. Means that a service from Windows has just access the file in the moment when composer want to do some changes.&lt;/p&gt;

&lt;p&gt;So no problem, I run it again and this time it works, perfect.&lt;/p&gt;

&lt;p&gt;Composer has updated the api-platform/core to the version "2.6.8"&lt;/p&gt;

&lt;p&gt;I open my webpage and...YES the 500 error is gone and my page was loading, lucky again.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>composer</category>
    </item>
    <item>
      <title>Symfony 4.2 - Creating an entity with the maker-bundle and migrate it</title>
      <dc:creator>JerDox</dc:creator>
      <pubDate>Tue, 21 Jun 2022 13:55:00 +0000</pubDate>
      <link>https://dev.to/jerdox/symfony-42-creating-an-entity-with-the-maker-bundle-and-migrate-it-30co</link>
      <guid>https://dev.to/jerdox/symfony-42-creating-an-entity-with-the-maker-bundle-and-migrate-it-30co</guid>
      <description>&lt;p&gt;After I installed the API-Platfrom in my last &lt;a href="https://dev.to/jerdox/symfony-42-installing-api-platfrom-for-using-web-services-3fd7"&gt;Post&lt;/a&gt;, I'd like to create an entity which I want to used for a new web service.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;My setup is:&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;php 7.1.3&lt;/li&gt;
&lt;li&gt;Symfony 4.2 (later 4.4)&lt;/li&gt;
&lt;li&gt;API-Platfrom/core 2.1&lt;/li&gt;
&lt;li&gt;maker-bundle 1.12&lt;/li&gt;
&lt;li&gt;Doctrine ORM 2.7&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Behind the scenes I used the MS SQL Server 2016 as Database.&lt;/p&gt;

&lt;p&gt;With the maker-bundle it should be easy to create a new entity by using composer.&lt;/p&gt;

&lt;p&gt;So let's start. In the Terminal run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php bin/console make:entity&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After pressing Enter the Terminal will ask you some Question to create that entity.&lt;/p&gt;

&lt;p&gt;Q1:&lt;br&gt;
&lt;code&gt;Class name of the entity to create or update (e.g. DeliciousPuppy):&lt;/code&gt;&lt;br&gt;
-&amp;gt; apiTest&lt;/p&gt;

&lt;p&gt;Q2:&lt;br&gt;
&lt;code&gt;Mark this class as an API Platform resource (expose a CRUD API for it) (yes/no) [no]:&lt;/code&gt;&lt;br&gt;
-&amp;gt; that's comes because we installed the API-Platfrom. So I want it to be an API resource I answer with "&lt;strong&gt;yes&lt;/strong&gt;"&lt;/p&gt;

&lt;p&gt;... and then error...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In DoctrineHelper.php line 314:

  Warning: Invalid argument supplied for foreach()                                                      
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay, because I have no idea what the problem is I googeling and found that this can be happen because of an older version of the maker-bundle. (Post a GitHub Issue - &lt;a href="https://github.com/symfony/maker-bundle/issues/989"&gt;Link&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I take a look on &lt;a href="https://packagist.org/packages/symfony/maker-bundle"&gt;Packagist.org &lt;/a&gt; to find the lastest version which I can use. &lt;/p&gt;

&lt;p&gt;I decide to update to version 1.35 of the maker-bundle because it works with my php version 7.1.3 and also it's the last version which require Symfony version 4.0 later versions using Symfony 4.4.&lt;/p&gt;

&lt;p&gt;So in my composer.json I changed the version of the maker-bundle from "^1.12" to "^1.35.0".&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Digression &lt;strong&gt;"^"-operator&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
If I understand the documentation for the versioning of bundles in the composer.json right - and I not sure I do - (&lt;a href="https://getcomposer.org/doc/articles/versions.md"&gt;Link&lt;/a&gt;)&lt;br&gt;
the "^"-operator is to accept a version range of this bundle to the next versioning level which I have specified. I my case I think "^1.35.0" is the range of "1.35.0 to &amp;lt; 1.36"&lt;/p&gt;

&lt;p&gt;Okay back on track I run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer update --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... it runs and ends successfully, but strange, composer told me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So it seems that composer did not make any changes. To get the information which version is installed I run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer show&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which tells me that the maker-bundle is installed in version 1.35:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
symfony/maker-bundle  v1.35.0   Symfony Maker
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;... so it seems to me that it was already installed in version 1.35. I take a look in the composer.lock file of a backup and yes it already was on version 1.35 before I updated it. In the future I should check the versions before make a change in the composer.json&lt;/p&gt;

&lt;p&gt;So that's not solves my problem with creating an entity. &lt;/p&gt;

&lt;p&gt;Next I try the default action and clear the composer cache with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer clearcache&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... makes not different, still the same error by creating an entity...&lt;/p&gt;

&lt;p&gt;Found the next article which refers to this error (&lt;a href="https://github.com/symfony/maker-bundle/pull/993"&gt;GitHub&lt;/a&gt;). &lt;br&gt;
... at the end I think need to update the maker-bundle to version 1.36.&lt;br&gt;
But for me it seems that I also have to update my Symfony version to 4.4 as a requirement of the maker-bundle 1.36. &lt;/p&gt;

&lt;p&gt;So because I don't see another way to solve my problem I'll update my Symfony version to 4.4.&lt;br&gt;
&lt;a href="https://dev.to/jerdox/updating-symfony-42-to-44-i48"&gt;Post: Updateing Symfony 4.2 to 4.4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After I has updated my Symfony version to 4.4, I see that also the maker-bundle was updated to version 1.39.0, so hopefully this has solved my problem too.&lt;/p&gt;

&lt;p&gt;Let's figure out by running again:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php bin/console make:entity&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This time after Q2: it dose not drops an error, yeah...&lt;/p&gt;

&lt;p&gt;So let's go-ahead and creating some properties "name" and "age"&lt;/p&gt;

&lt;p&gt;Q3: &lt;br&gt;
&lt;code&gt;New property name (press &amp;lt;return&amp;gt; to stop adding fields):&lt;/code&gt; &lt;br&gt;
-&amp;gt; name&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Field type (enter ? to see all types) [string]:&lt;/code&gt;&lt;br&gt;
-&amp;gt; string&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Field length [255]:&lt;/code&gt;&lt;br&gt;
-&amp;gt; 255&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Can this field be null in the database (nullable) (yes/no) [no]:&lt;/code&gt;&lt;br&gt;
-&amp;gt;&lt;/p&gt;

&lt;p&gt;Add the other property "age"&lt;/p&gt;

&lt;p&gt;Q4:&lt;br&gt;
&lt;code&gt;Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;/code&gt;&lt;br&gt;
-&amp;gt; age&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Field type (enter ? to see all types) [string]:&lt;/code&gt;&lt;br&gt;
 -&amp;gt; integer&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Can this field be null in the database (nullable) (yes/no) [no]:&lt;/code&gt;&lt;br&gt;
 -&amp;gt; no &lt;/p&gt;

&lt;p&gt;Then exit the dialog by clicking enter.&lt;/p&gt;

&lt;p&gt;At the end I get the message&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Success! 


Next: When you're ready, create a migration with php bin/console make:migration

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So let's do that with the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php bin/console make:migration&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If the user you used with doctrine to access your database did not have the right to create a table you will get the following error message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In DBALException.php line 185:

  An exception occurred while executing 'CREATE TABLE migration_versions (version NVARCHAR(14) NOT NULL, executed_at DATETIME NOT NULL, PRIMARY KEY (version))':  

  SQLSTATE [42000, 262]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]CREATE TABLE permission denied in database 'BCMS_FERON'.                           


In Error.php line 45:

  SQLSTATE [42000, 262]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]CREATE TABLE permission denied in database '&amp;lt;dbName&amp;gt;'.  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After I extend the permission for this user the command runs successfully, perfect.&lt;/p&gt;

&lt;p&gt;And as before in the terminal we find the message what we should do next:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Success! 


 Next: Review the new migration "src/Migrations/Version20220621131505.php"
 Then: Run the migration with php bin/console doctrine:migrations:migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay I go on an run the recommended command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php bin/console doctrine:migrations:migrate&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;After confirm the question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which I answering with "yes", it runs and fails.&lt;/p&gt;

&lt;p&gt;Looks like doctrine has a problem with parts of the structure of the database. Because I didn't want to figure out what exactly the problem is, I decide to reduce the created migration-file (you can find it at src/Migrations/Version.php) in a way that only the entries for the new entity "&lt;strong&gt;apiTest&lt;/strong&gt;" is still inside.&lt;/p&gt;

&lt;p&gt;So in the end in the migration-file is nothing more then create-SQL statement for this new table:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE api_test (id INT IDENTITY NOT NULL, name NVARCHAR(255) NOT NULL, age INT NOT NULL, PRIMARY KEY (id))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(you can easily go directly into the database and create the table with this statement by your self)&lt;/p&gt;

&lt;p&gt;After that change, the command:&lt;br&gt;
&lt;code&gt;php bin/console doctrine:migrations:migrate&lt;/code&gt;&lt;br&gt;
runs without an error.&lt;/p&gt;

&lt;p&gt;And we done - creating an entity with the maker-bundle and migrate it to the database.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>composer</category>
      <category>doctrine</category>
    </item>
    <item>
      <title>Updating Symfony 4.2 to 4.4</title>
      <dc:creator>JerDox</dc:creator>
      <pubDate>Tue, 21 Jun 2022 12:56:39 +0000</pubDate>
      <link>https://dev.to/jerdox/updating-symfony-42-to-44-i48</link>
      <guid>https://dev.to/jerdox/updating-symfony-42-to-44-i48</guid>
      <description>&lt;p&gt;I've worked a long time with Symfony 4.2 and I never had the need to update it in the last years.&lt;/p&gt;

&lt;p&gt;But now I it seems to me that I have to update min. to version 4.4. because of an error in the maker-bundle which was seems to be fixed in a version that needs Symfony 4.4. (&lt;a href="https://github.com/symfony/maker-bundle/issues/989"&gt;GitHub Issue&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;So let's start:&lt;br&gt;
In my existing Symfony Project my composer.json looking like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "api-platform/core": "2.1",
        "doctrine/annotations": "^1.0",
        "doctrine/doctrine-bundle": "^1.11",
        "doctrine/doctrine-migrations-bundle": "^2.0",
        "doctrine/orm": "^2.7",
        "nelmio/cors-bundle": "^1.5 || ^2.0",
        "phpdocumentor/reflection-docblock": "^3.0 || ^4.0 || ^5.0",
        "sensio/framework-extra-bundle": "^5.2",
        "symfony/apache-pack": "^1.0",
        "symfony/asset": "4.2.*",
        "symfony/console": "4.2.*",
        "symfony/dotenv": "4.2.*",
        "symfony/expression-language": "4.2.*",
        "symfony/flex": "^1.1",
        "symfony/framework-bundle": "4.2.*",
        "symfony/security-bundle": "4.2.*",
        "symfony/twig-bundle": "4.2.*",
        "symfony/validator": "4.2.*",
        "symfony/webpack-encore-bundle": "^1.7",
        "symfony/yaml": "4.2.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true,
        "allow-plugins": {
            "ocramius/package-versions": true,
            "symfony/flex": true
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.2.*"
        }
    },
    "require-dev": {
        "symfony/debug-bundle": "4.2.*",
        "symfony/maker-bundle": "^1.35.0",
        "symfony/monolog-bundle": "^3.0",
        "symfony/stopwatch": "4.2.*",
        "symfony/web-profiler-bundle": "4.2.*"
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;1. Step:&lt;/u&gt;&lt;br&gt;
I changed all references of "symfony/..." with the version "4.2" inside to "4.4.*" ('*' is specify a wildcard. That means that the updates can be &amp;gt;= 4.4.0 and &amp;lt; 4.5 if I've understand that correctly) (&lt;a href="https://getcomposer.org/doc/articles/versions.md"&gt;composer docs&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;u&gt;2. Step:&lt;/u&gt;&lt;br&gt;
I open a terminal and navigate to the directory where the Symfony-Project is lives in and run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer update symfony/* --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... and YES for my surprise it succeeded without any error message. This was much easier as I expected.&lt;/p&gt;

&lt;p&gt;There is also a good tutorial for updating Symfony to version 4.4 on &lt;a href="https://symfonycasts.com/screencast/symfony5-upgrade/upgrade-4.4"&gt;Symfonycast&lt;/a&gt;&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>composer</category>
    </item>
    <item>
      <title>Symfony (4.2) installing "API- Platfrom" for using Web-Services</title>
      <dc:creator>JerDox</dc:creator>
      <pubDate>Tue, 21 Jun 2022 07:54:18 +0000</pubDate>
      <link>https://dev.to/jerdox/symfony-42-installing-api-platfrom-for-using-web-services-3fd7</link>
      <guid>https://dev.to/jerdox/symfony-42-installing-api-platfrom-for-using-web-services-3fd7</guid>
      <description>&lt;p&gt;I have a Symfony (4.2) project and need to setup/communicate with a web-service. &lt;br&gt;
So after a short search I found that there is a package for Symfony which should makes handling of web-services easy. &lt;br&gt;
It's called "&lt;strong&gt;API Platform&lt;/strong&gt;".&lt;/p&gt;

&lt;p&gt;On Symfonycast I found a video of how to install the API-Platform &lt;a href="https://symfonycasts.com/screencast/api-platform/install?cid=apip"&gt;Symfonycast&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sounds easy, so let's do it by easily run the command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api:1.2.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to install api-platfrom via composer&lt;/p&gt;

&lt;p&gt;... and it fails with the message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require.api is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$". 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For me it seems that it did not find the api recipe. So on the github page of the Symfony/flex Bundle I found the List of existing recipes &lt;a href="https://github.com/symfony/recipes/blob/flex/main/RECIPES.md"&gt;RecipeList&lt;/a&gt; and in it there was no "api" recipe only a "api-platform/core" recipe. So I tryed that with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/core&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... and it fails again this time with another error message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/flex is locked to version v1.6.2 and an update of this package was not requested.
    - symfony/flex v1.6.2 requires composer-plugin-api ^1.0 -&amp;gt; found composer-plugin-api[2.3.0] but it does not match the constraint.
  Problem 2
    - api-platform/core[v2.6.0, ..., v2.6.6] require symfony/http-foundation ^4.4 || ^5.1 -&amp;gt; found symfony/http-foundation[v4.4.0, ..., v4.4.42, v5.1.0, ..., v5.4.9] but the package is fixed to v4.2.12 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - api-platform/core[v2.6.7, ..., v2.6.8] require symfony/http-foundation ^4.4 || ^5.1 || ^6.0 -&amp;gt; found symfony/http-foundation[v4.4.0, ..., v4.4.42, v5.1.0, ..., v5.4.9, v6.0.0, ..., v6.1.1] but the package is fixed to v4.2.12 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.  
    - Root composer.json requires api-platform/core ^2.6 -&amp;gt; satisfiable by api-platform/core[v2.6.0, ..., v2.6.8].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require api-platform/core:*" to figure out if any version is installable, or "composer require api-platform/core:^2.1" if you know which you need.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...as the message said in the last sentence, I try it with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/core:*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;...also not working. Message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/flex is locked to version v1.6.2 and an update of this package was not requested.
    - symfony/flex v1.6.2 requires composer-plugin-api ^1.0 -&amp;gt; found composer-plugin-api[2.3.0] but it does not match the constraint.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next I try it with the option "--with-all-dependencies" which was also recommended in the error message before. So I run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/core:* --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... it ends up with the same error message as before.&lt;/p&gt;

&lt;p&gt;I take a look back to the Symfonycast tutorial. On the page it the possibility to see the composer.json which was used in the tutorial. I see that the symfony version was the same as my "4.2" the api-platform/core was of version "^2.1". So I tried the command with the version "^2.1":&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/core:^2.1 --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... nope, not working, error message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/flex is locked to version v1.6.2 and an update of this package was not requested.
    - symfony/flex v1.6.2 requires composer-plugin-api ^1.0 -&amp;gt; found composer-plugin-api[2.3.0] but it does not match the constraint.
  Problem 2
    - ocramius/package-versions 1.4.2 requires composer-plugin-api ^1.0.0 -&amp;gt; found composer-plugin-api[2.3.0] but it does not match the constraint.
    - doctrine/doctrine-migrations-bundle 2.1.2 requires doctrine/migrations ^2.2 -&amp;gt; satisfiable by doctrine/migrations[2.2.1].
    - symfony/orm-pack v1.0.8 requires doctrine/doctrine-migrations-bundle * -&amp;gt; satisfiable by doctrine/doctrine-migrations-bundle[2.1.2].
    - doctrine/migrations 2.2.1 requires ocramius/package-versions ^1.3 -&amp;gt; satisfiable by ocramius/package-versions[1.4.2].
    - symfony/orm-pack is locked to version v1.0.8 and an update of this package was not requested.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's frustrating :/ ...&lt;/p&gt;

&lt;p&gt;Next what I was going to do was to clear the cache of composer, in hope that that's the problem. I run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer clearcache&lt;/code&gt; &lt;br&gt;
That's done without any error message and then run again:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/core:^2.1 --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... nope that don't make a different...&lt;/p&gt;

&lt;p&gt;Okay, next thing I've done was to delete my composer.lock and my vendor-folder and do a complete install of the dependencies with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next error. This time after composer installed all dependencies and then try to clear the cache. Message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Script cache:clear returned with error code 1
!!
!!  In ArrayNode.php line 331:
!!  

!!    Unrecognized options "dir_name, namespace" under "doctrine_migrations". Available options are "all_or_nothing", "check_database_platform", "connection
"
!!    , "custom_template", "em", "factories", "migrations", "migrations_paths", "organize_migrations", "services", "storage".

!!  

!!
!!
Script @auto-scripts was called via post-update-cmd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a short googleing it seems that this error comes from the &lt;strong&gt;doctrine/doctrine-migrations-bundle&lt;/strong&gt; dependency which should be use in version 2.0 but installed was 3.0.&lt;br&gt;
So I changed the corresponding entry of this package in the composer.json to version 2.0 and run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer update --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;...and surprise done without an error message. &lt;br&gt;
Okay new hope for my actual problem. &lt;br&gt;
As a reminder I want to install the api-platform with composer...&lt;/p&gt;

&lt;p&gt;So I run again:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/core:^2.1 --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;... and YES it installed the api-platfrom dependency without an error messages. I hadn't believed in it anymore after this chain of error (pain).&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Supplement&lt;/strong&gt;:&lt;br&gt;
As I continued with the Tutorial from Symfonycast I saw that with the origin command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api:1.2.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;they installed not only just the api-platform/core bundle but also some other bundles with seems to be helpful.&lt;/p&gt;

&lt;p&gt;They installes a package with called api-platform/api-pack which contains the following child bundles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;api-platform/core&lt;/li&gt;
&lt;li&gt;nelmio/cors-bundle&lt;/li&gt;
&lt;li&gt;symfony/asset&lt;/li&gt;
&lt;li&gt;symfony/expression-language&lt;/li&gt;
&lt;li&gt;symfony/orm-pack&lt;/li&gt;
&lt;li&gt;symfony/security-bundle&lt;/li&gt;
&lt;li&gt;symfony/serializer-pack&lt;/li&gt;
&lt;li&gt;symfony/twig-bundle&lt;/li&gt;
&lt;li&gt;symfony/validator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think that I also need those bundles later on. So back in the "rabbit hole of dependencies" I run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require api-platform/api-pack:1.2.2 --with-all-dependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;...runs and ...also successful, puhhh yeah.&lt;/p&gt;

&lt;p&gt;I used the version 1.2.2 of the api-pack, because this was the latest version in which the api-platfrom/core:2.1 was included. &lt;br&gt;
Those Informations about the composer bundles you can find under:&lt;br&gt;&lt;br&gt;
&lt;a href="https://packagist.org/packages/api-platform/api-pack#v1.2.2"&gt;Packagist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See you next time in the dependency hell...&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
