Skip to main content

Create OpenAPI mock server

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Creating a mock server from a Swagger/OpenAPI file is a powerful way to decouple front-end and back-end development. It allows front-end developers to start building and testing their applications against a realistic API without waiting for the back-end to be completed.

Here's a step-by-step guide on how to set up a simple mock server using your OpenAPI specification file.

required in OpenAPI (or Swagger)

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The meaning of required in OpenAPI (or Swagger) is consistent across all major versions: it specifies that a property must be present in the data payload. However, how you use and apply the keyword has evolved between versions.

__init__.py use cases in Python

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

__init__.py is a special file that designates a directory as a Python package. You can leverage it to perform powerful package-level operations that go beyond a simple empty file, including managing the public API, handling circular dependencies, and dynamic module loading.

Git error: 'main/' does not have a commit checked out`

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The error error: 'main/' does not have a commit checked out occurs when Git tries to add files to a submodule that is in a detached HEAD state or has no checked-out commit. This happens because the main repository expects the submodule to point to a specific commit, but it's in an invalid state.

To fix this, you need to navigate into the submodule's directory and check out a commit, usually by switching to the main branch or a specific branch.

Fix Git refusing to merge unrelated histories

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The "refusing to merge unrelated histories" error occurs when you try to merge two branches that do not share a common history. This typically happens when you initialize a new Git repository and then try to pull a remote repository's contents into it, as Git sees them as two completely separate projects.

To solve this, you can use the --allow-unrelated-histories flag. This flag forces Git to merge the two independent histories, creating a merge commit that joins them together.

Fix git pull - not possible to fast-forward

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

How to Solve "Not Possible to Fast-Forward" with git pull

The git pull "Not possible to fast-forward" error happens when your local branch and the remote branch have diverged. This means there are new commits on the remote branch that you don't have, and you also have local commits that are not on the remote branch. Git cannot simply move your branch pointer forward (fast-forward) because doing so would lose your local changes.

To fix this, you must explicitly tell Git how to merge the divergent histories. There are two primary solutions: using git pull with rebase or performing a standard git pull followed by a manual merge.

Save username and password in Git

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

To save your username and password in Git, you can configure a credential helper. A credential helper is a Git component that securely stores your authentication information in memory or on disk, so you don't have to enter it every time you interact with a remote repository.

Fix 'Write access to repository not granted' in Git/GitHub

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The fatal: unable to access error with the message "Write access to repository not granted" typically means you don't have the necessary permissions to push changes to the GitHub repository. It's a clear signal from the server that your authentication credentials, while valid, don't grant you the required write access.

Here's how to diagnose and solve this issue: